تشريح المكوّنات وبنيتها
فكّك مكوّنات واجهة المستخدم الشائعة لفهم أجزائها الأساسية وحالاتها وتنوعاتها
تشريح المكوّنات وبنيتها درس مجاني في Design Systems & Component Libraries على CoddyKit. هذا هو الدرس 2 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Design Systems & Component Libraries، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Design Systems & Component Libraries 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Deconstructing UI Components
Welcome! In this lesson, we'll explore the essential building blocks of user interface (UI) components.
Understanding component anatomy helps us create consistent designs and build UIs efficiently.
What Makes a Component?
Every UI component, from a simple button to a complex navigation bar, is made up of fundamental parts.
These parts fit together, much like LEGO bricks, to form the complete element and define its behavior.
Button: Basic Anatomy
Let's deconstruct a common component: a button.
A button typically has a visible container, text (a label), and sometimes an icon. These are its core anatomical parts.
<button class="my-button">
<span class="button-label">Click Me</span>
</button>Understanding Component States
Components aren't static! They react to user interactions or system conditions. These different reactions are called states.
States provide visual feedback, making the UI feel responsive and intuitive.
Common Component States
Here are some common states a component might have:
- Default: The initial, inactive appearance.
- Hover: When the mouse pointer is over the component.
- Focus: When the component is selected, usually via keyboard navigation.
- Active: While the component is being pressed or clicked.
- Disabled: When the component is temporarily inactive and cannot be interacted with.
Button States Example
Imagine a button's appearance changing:
- Default: Blue background, white text.
- Hover: Slightly darker blue background.
- Active: Even darker blue, perhaps with a subtle shadow.
- Disabled: Light gray background, lighter text, not clickable.
Component Variations & Types
Beyond states, components often come in different variations or types to fit various contexts. Think of them as different 'flavors' of the same component.
For example, a button might be 'Primary' (for main actions) or 'Secondary' (for less prominent actions).
Card: A More Complex Anatomy
A 'Card' is a common UI component that groups related information. Its anatomy is richer:
- Header: Title, subtitle.
- Media: Image or video.
- Body: Main text content.
- Actions: Buttons or links for interaction.
<div class="card">
<img src="placeholder.jpg" alt="Card Image" class="card-image">
<div class="card-content">
<h3>Card Title</h3>
<p>Short description text.</p>
</div>
<button class="card-action">Action</button>
</div>Data & Component Structure
Components can be made dynamic by accepting data, often called 'props'. This data can change their content or even their structural parts.
For example, a <Card> component might take title, imageSrc, and description props to customize its content.
Component State Check
Let's check your understanding of component states.
Recap: Anatomy & Structure
Great job! We've learned that UI components are built from smaller parts (anatomy) and react to interactions through different states (default, hover, focus, active, disabled).
Understanding anatomy, states, and variations is key to building consistent, user-friendly, and maintainable UIs.
الأسئلة الشائعة
هل درس «تشريح المكوّنات وبنيتها» مجاني؟
نعم — نص درس «تشريح المكوّنات وبنيتها» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Design Systems & Component Libraries، انتقل إلى CoddyKit PRO. تتضمن دورة Design Systems & Component Libraries 4 دروس في المجموع.
ماذا ستتعلم في «تشريح المكوّنات وبنيتها»؟
فكّك مكوّنات واجهة المستخدم الشائعة لفهم أجزائها الأساسية وحالاتها وتنوعاتها تتمرن على Design Systems & Component Libraries مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Design Systems & Component Libraries؟
لا تُشترط خبرة سابقة. Design Systems & Component Libraries على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 2 من أصل 4.
كم من الوقت يستغرق درس «تشريح المكوّنات وبنيتها»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Design Systems & Component Libraries هذا؟
نعم. كل درس في Design Systems & Component Libraries يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- منهجية Atomic Design
- تشريح المكوّنات وبنيتها
- اختيار مكوّنات حزمة التقنيات
- اتفاقيات تسمية المكونات