core-components by sickn33/antigravity-awesome-skills
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill core-components请使用核心库中的组件,而非原始平台组件。这能确保样式和行为的一致性。
切勿硬编码数值。务必使用设计令牌。
// CORRECT - Use tokens
<Box padding="$4" marginBottom="$2" />
// WRONG - Hard-coded values
<Box padding={16} marginBottom={8} />
| 令牌 | 数值 |
|---|---|
$1 | 4px |
$2 | 8px |
$3 | 12px |
$4 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 16px |
$6 | 24px |
$8 | 32px |
// CORRECT - Semantic tokens
<Text color="$textPrimary" />
<Box backgroundColor="$backgroundSecondary" />
// WRONG - Hard-coded colors
<Text color="#333333" />
<Box backgroundColor="rgb(245, 245, 245)" />
| 语义令牌 | 用途 |
|---|---|
$textPrimary | 主要文本 |
$textSecondary | 辅助文本 |
$textTertiary | 禁用/提示文本 |
$primary500 | 品牌/强调色 |
$statusError | 错误状态 |
$statusSuccess | 成功状态 |
<Text fontSize="$lg" fontWeight="$semibold" />
| 令牌 | 尺寸 |
|---|---|
$xs | 12px |
$sm | 14px |
$md | 16px |
$lg | 18px |
$xl | 20px |
$2xl | 24px |
支持令牌的基础布局组件:
<Box
padding="$4"
backgroundColor="$backgroundPrimary"
borderRadius="$lg"
>
{children}
</Box>
水平和垂直弹性布局:
<HStack gap="$3" alignItems="center">
<Icon name="user" />
<Text>用户名</Text>
</HStack>
<VStack gap="$4" padding="$4">
<Heading>标题</Heading>
<Text>内容</Text>
</VStack>
支持令牌的排版组件:
<Text
fontSize="$lg"
fontWeight="$semibold"
color="$textPrimary"
>
Hello World
</Text>
包含多种变体的交互式按钮:
<Button
onPress={handlePress}
variant="solid"
size="md"
isLoading={loading}
isDisabled={disabled}
>
点击我
</Button>
| 变体 | 用途 |
|---|---|
solid | 主要操作 |
outline | 次要操作 |
ghost | 三级/次要操作 |
link | 内联操作 |
包含验证的表单输入框:
<Input
value={value}
onChangeText={setValue}
placeholder="输入文本"
error={touched ? errors.field : undefined}
label="字段名称"
/>
内容容器:
<Card padding="$4" gap="$3">
<CardHeader>
<Heading size="sm">卡片标题</Heading>
</CardHeader>
<CardBody>
<Text>卡片内容</Text>
</CardBody>
</Card>
const MyScreen = () => (
<Screen>
<ScreenHeader title="页面标题" />
<ScreenContent padding="$4">
{/* 内容 */}
</ScreenContent>
</Screen>
);
<VStack gap="$4" padding="$4">
<Input label="姓名" {...nameProps} />
<Input label="邮箱" {...emailProps} />
<Button isLoading={loading}>提交</Button>
</VStack>
<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>
// WRONG - Hard-coded values
<View style={{ padding: 16, backgroundColor: '#fff' }}>
// CORRECT - Design tokens
<Box padding="$4" backgroundColor="$backgroundPrimary">
// WRONG - Raw platform components
import { View, Text } from 'react-native';
// CORRECT - Core components
import { Box, Text } from 'components/core';
// WRONG - Inline styles
<Text style={{ fontSize: 18, fontWeight: '600' }}>
// CORRECT - Token props
<Text fontSize="$lg" fontWeight="$semibold">
创建组件时,请使用基于令牌的属性:
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>
);
本技能适用于执行概述中描述的工作流或操作。
每周安装量
275
代码仓库
GitHub 星标数
27.4K
首次出现时间
2026年1月19日
安全审计
已安装于
claude-code228
gemini-cli218
opencode218
antigravity204
cursor190
codex188
Use components from your core library instead of raw platform components. This ensures consistent styling and behavior.
NEVER hard-code values. Always use design tokens.
// CORRECT - Use tokens
<Box padding="$4" marginBottom="$2" />
// WRONG - Hard-coded values
<Box padding={16} marginBottom={8} />
| Token | Value |
|---|---|
$1 | 4px |
$2 | 8px |
$3 | 12px |
$4 | 16px |
$6 | 24px |
$8 | 32px |
// CORRECT - Semantic tokens
<Text color="$textPrimary" />
<Box backgroundColor="$backgroundSecondary" />
// WRONG - Hard-coded colors
<Text color="#333333" />
<Box backgroundColor="rgb(245, 245, 245)" />
| Semantic Token | Use For |
|---|---|
$textPrimary | Main text |
$textSecondary | Supporting text |
$textTertiary | Disabled/hint text |
$primary500 | Brand/accent color |
$statusError | Error states |
$statusSuccess | Success states |
<Text fontSize="$lg" fontWeight="$semibold" />
| Token | Size |
|---|---|
$xs | 12px |
$sm | 14px |
$md | 16px |
$lg | 18px |
$xl | 20px |
$2xl | 24px |
Base layout component with token support:
<Box
padding="$4"
backgroundColor="$backgroundPrimary"
borderRadius="$lg"
>
{children}
</Box>
Horizontal and vertical flex layouts:
<HStack gap="$3" alignItems="center">
<Icon name="user" />
<Text>Username</Text>
</HStack>
<VStack gap="$4" padding="$4">
<Heading>Title</Heading>
<Text>Content</Text>
</VStack>
Typography with token support:
<Text
fontSize="$lg"
fontWeight="$semibold"
color="$textPrimary"
>
Hello World
</Text>
Interactive button with variants:
<Button
onPress={handlePress}
variant="solid"
size="md"
isLoading={loading}
isDisabled={disabled}
>
Click Me
</Button>
| Variant | Use For |
|---|---|
solid | Primary actions |
outline | Secondary actions |
ghost | Tertiary/subtle actions |
link | Inline actions |
Form input with validation:
<Input
value={value}
onChangeText={setValue}
placeholder="Enter text"
error={touched ? errors.field : undefined}
label="Field Name"
/>
Content container:
<Card padding="$4" gap="$3">
<CardHeader>
<Heading size="sm">Card Title</Heading>
</CardHeader>
<CardBody>
<Text>Card content</Text>
</CardBody>
</Card>
const MyScreen = () => (
<Screen>
<ScreenHeader title="Page Title" />
<ScreenContent padding="$4">
{/* Content */}
</ScreenContent>
</Screen>
);
<VStack gap="$4" padding="$4">
<Input label="Name" {...nameProps} />
<Input label="Email" {...emailProps} />
<Button isLoading={loading}>Submit</Button>
</VStack>
<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>
// WRONG - Hard-coded values
<View style={{ padding: 16, backgroundColor: '#fff' }}>
// CORRECT - Design tokens
<Box padding="$4" backgroundColor="$backgroundPrimary">
// WRONG - Raw platform components
import { View, Text } from 'react-native';
// CORRECT - Core components
import { Box, Text } from 'components/core';
// WRONG - Inline styles
<Text style={{ fontSize: 18, fontWeight: '600' }}>
// CORRECT - Token props
<Text fontSize="$lg" fontWeight="$semibold">
When creating components, use token-based props:
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>
);
This skill is applicable to execute the workflow or actions described in the overview.
Weekly Installs
275
Repository
GitHub Stars
27.4K
First Seen
Jan 19, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code228
gemini-cli218
opencode218
antigravity204
cursor190
codex188
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
106,200 周安装