Chuyển đến nội dung
Skillpedia
Giao diện (UI/UX)48k · #4272

core-components

Skill này làm gì

Công cụ này giúp xây dựng giao diện trực quan cho ứng dụng. Nó cung cấp các khối xây dựng có sẵn (component) và quy tắc kiểu dáng (token) để mọi thứ đẹp và hoạt động nhất quán.

Khi nào nên dùng

  • ✓Khi tạo diện mạo và cảm giác cho một ứng dụng.
  • ✓Khi bạn cần màu sắc, khoảng cách hoặc cỡ chữ tiêu chuẩn.
  • ✓Để đảm bảo các phần khác nhau của ứng dụng trông giống nhau.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/core-components/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/core-components/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tạo một nút xanh có chữ “Submit” và ở trạng thái bị vô hiệu hóa.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ dùng “component”, giống như những viên gạch Lego để xây giao diện. Nó cũng dùng “token”, là các giá trị định sẵn cho màu sắc và khoảng cách, thay vì số ngẫu nhiên, để mọi thứ đồng nhất.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Core Components

Design System Overview

Use components from your core library instead of raw platform components. This ensures consistent styling and behavior.

Design Tokens

NEVER hard-code values. Always use design tokens.

Spacing 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

Color Tokens

// 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

Typography Tokens

<Text fontSize="$lg" fontWeight="$semibold" />
Token Size
$xs 12px
$sm 14px
$md 16px
$lg 18px
$xl 20px
$2xl 24px

Core Components

Box

Base layout component with token support:

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

HStack / VStack

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>

Text

Typography with token support:

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

Button

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

Input

Form input with validation:

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

Card

Content container:

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

Layout Patterns

Screen Layout

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

Form Layout

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

List Item Layout

<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-Patterns

// 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">

Component Props Pattern

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>
);

Integration with Other Skills

…

Câu hỏi thường gặp

“Component” là gì?

Đây là các khối xây dựng sẵn sàng dùng, như nút bấm, ô nhập văn bản và bố cục, giúp việc tạo giao diện ứng dụng dễ hơn.

“Token” là gì?

Đây là các giá trị tiêu chuẩn cho màu sắc, khoảng cách và cỡ chữ. Dùng token giúp ứng dụng có diện mạo nhất quán ở mọi nơi.

Vì sao không nên dùng trực tiếp màu sắc hay số liệu?

Dùng token thay vì giá trị cố định (như “#FFFFFF” hoặc “16px”) giúp ứng dụng dễ cập nhật và giữ thiết kế thống nhất, ngay cả khi kiểu dáng thay đổi.

Chi tiết

Mô tả gốc của tác giả

Core component library and design system patterns. Use when building UI, using design tokens, or working with the component library.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4272
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự