Skip to content

artubss/SKILLS-CLAUDE-CODE / skills/skills/development/core-components

core-components

Unverified

Biblioteca de componentes principais e padrões de sistema de design. Use ao construir UI, utilizar design tokens ou trabalhar com a biblioteca de componentes.

Componentes Principais

Visão Geral do Sistema de Design

Use componentes da sua biblioteca principal em vez de componentes brutos da plataforma. Isso garante estilo e comportamento consistentes.

Design Tokens

NUNCA hard-code valores. Sempre use design tokens.

Tokens de Espaçamento

// CORRETO - Use tokens
<Box padding="$4" marginBottom="$2" />

// ERRADO - Valores hard-coded
<Box padding={16} marginBottom={8} />
TokenValor
$14px
$28px
$312px
$416px
$624px
$832px

Tokens de Cor

// CORRETO - Tokens semânticos
<Text color="$textPrimary" />
<Box backgroundColor="$backgroundSecondary" />

// ERRADO - Cores hard-coded
<Text color="#333333" />
<Box backgroundColor="rgb(245, 245, 245)" />
Token SemânticoUse Para
$textPrimaryTexto principal
$textSecondaryTexto de suporte
$textTertiaryTexto desabilitado/dica
$primary500Cor da marca/destaque
$statusErrorEstados de erro
$statusSuccessEstados de sucesso

Tokens de Tipografia

<Text fontSize="$lg" fontWeight="$semibold" />
TokenTamanho
$xs12px
$sm14px
$md16px
$lg18px
$xl20px
$2xl24px

Componentes Principais

Box

Componente base de layout com suporte a tokens:

<Box
  padding="$4"
  backgroundColor="$backgroundPrimary"
  borderRadius="$lg"
>
  {children}
</Box>

HStack / VStack

Layouts flex horizontais e verticais:

<HStack gap="$3" alignItems="center">
  <Icon name="user" />
  <Text>Username</Text>
</HStack>

<VStack gap="$4" padding="$4">
  <Heading>Title</Heading>
  <Text>Content</Text>
</VStack>

Text

Tipografia com suporte a tokens:

<Text
  fontSize="$lg"
  fontWeight="$semibold"
  color="$textPrimary"
>
  Hello World
</Text>

Button

Botão interativo com variantes:

<Button
  onPress={handlePress}
  variant="solid"
  size="md"
  isLoading={loading}
  isDisabled={disabled}
>
  Click Me
</Button>
VarianteUse Para
solidAções primárias
outlineAções secundárias
ghostAções terciárias/sutis
linkAções inline

Input

Input de formulário com validação:

<Input
  value={value}
  onChangeText={setValue}
  placeholder="Enter text"
  error={touched ? errors.field : undefined}
  label="Field Name"
/>

Card

Contêiner de conteúdo:

<Card padding="$4" gap="$3">
  <CardHeader>
    <Heading size="sm">Card Title</Heading>
  </CardHeader>
  <CardBody>
    <Text>Card content</Text>
  </CardBody>
</Card>

Padrões de Layout

Layout de Tela

const MyScreen = () => (
  <Screen>
    <ScreenHeader title="Page Title" />
    <ScreenContent padding="$4">
      {/* Content */}
    </ScreenContent>
  </Screen>
);

Layout de Formulário

<VStack gap="$4" padding="$4">
  <Input label="Name" {...nameProps} />
  <Input label="Email" {...emailProps} />
  <Button isLoading={loading}>Submit</Button>
</VStack>

Layout de Item de Lista

<HStack
  padding="$4"
  gap="$3"
  alignItems="center"
  borderBottomWidth={1}
  borderColor="$borderLight"
>
  <Avatar source={{ uri: imageUrl }} size="md" />
  <VStack flex={1}>
    <Text fontWeight="$semibold">{title}</Text>
    <Text color="$textSecondary" fontSize="$sm">{subtitle}</Text>
  </VStack>
  <Icon name="chevron-right" color="$textTertiary" />
</HStack>

Anti-Padrões

// ERRADO - Valores hard-coded
<View style={{ padding: 16, backgroundColor: '#fff' }}>

// CORRETO - Design tokens
<Box padding="$4" backgroundColor="$backgroundPrimary">


// ERRADO - Componentes brutos da plataforma
import { View, Text } from 'react-native';

// CORRETO - Componentes principais
import { Box, Text } from 'components/core';


// ERRADO - Estilos inline
<Text style={{ fontSize: 18, fontWeight: '600' }}>

// CORRETO - Props com tokens
<Text fontSize="$lg" fontWeight="$semibold">

Padrão de Props de Componentes

Ao criar componentes, use props baseadas em tokens:

interface CardProps {
  padding?: '$2' | '$4' | '$6';
  variant?: 'elevated' | 'outlined' | 'filled';
  children: React.ReactNode;
}

const Card = ({ padding = '$4', variant = 'elevated', children }: CardProps) => (
  <Box
    padding={padding}
    backgroundColor="$backgroundPrimary"
    borderRadius="$lg"
    {...variantStyles[variant]}
  >
    {children}
  </Box>
);

Integração com Outras Skills

  • react-ui-patterns: Use componentes principais para estados de UI
  • testing-patterns: Mock componentes principais em testes
  • storybook: Documente variantes de componentes
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 318kUpdated Claude CodeCodexUnverifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 196kUpdated Claude CodeCodexVerifiedInstall