Skillpedia
الواجهات (UI/UX)48k · #4272

core-components

ما الذي تفعله

تساعد هذه المهارة على بناء الواجهات المرئية للتطبيقات. توفر أجزاء جاهزة (مكونات) وقواعد تنسيق (tokens) لضمان أن كل شيء يبدو جيدًا ويعمل بانسجام.

متى تستخدمها

  • ✓عندما أصمم شكل التطبيق وأسلوبه.
  • ✓عندما أحتاج إلى ألوان ومسافات وأحجام خطوط موحدة.
  • ✓عندما أريد أن تبدو أجزاء التطبيق المختلفة متشابهة.

رابط المهارة

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

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/core-components/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“أنشئ زرًا أزرق بالنص «Submit» وجعله معطّلًا.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تستخدم المهارة «المكونات» (components)، وهي كقطع الليغو لبناء الواجهة. وتستخدم أيضًا «الرموز» (tokens)، وهي قيم محددة مسبقًا للألوان والمسافات، بدلًا من أرقام عشوائية، لإبقاء كل شيء موحدًا.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

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

…

الأسئلة الشائعة

ما هي «المكونات» (components)؟

هي لبنات جاهزة للاستخدام، مثل الأزرار وحقول النص والتخطيطات، تسهّل إنشاء واجهة تطبيقك.

ما هي «الرموز» (tokens)؟

هي قيم موحدة للألوان والمسافات وأحجام الخطوط. استخدامها يضمن أن يبدو تطبيقك متناسقًا في كل مكان.

لماذا لا أستخدم الألوان أو الأرقام مباشرة؟

استخدام الرموز بدلًا من قيم ثابتة مثل «#FFFFFF» أو «16px» يسمح بتحديث تطبيقك بسهولة، ويحافظ على تصميم متماسك حتى عند تغيير الأنماط.

التفاصيل

الوصف الأصلي من المؤلف

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

الشعبية

نجوم GitHub
48k
الترتيب
#4272
الترخيص
MIT
آخر تحديث
15‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة