Component Anatomy & Structure
Deconstruct common UI components to understand their essential parts, states, and variations.
Component Anatomy & Structure is a free Design Systems & Component Libraries lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Design Systems & Component Libraries learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
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.
Frequently asked questions
Is the “Component Anatomy & Structure” lesson free?
Yes — the full text of “Component Anatomy & Structure” is free to read here on the web, and the Design Systems & Component Libraries course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Design Systems & Component Libraries course, upgrade to CoddyKit PRO.
What will I learn in “Component Anatomy & Structure”?
Deconstruct common UI components to understand their essential parts, states, and variations. You practise Design Systems & Component Libraries with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Design Systems & Component Libraries?
No prior experience is required. Design Systems & Component Libraries on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Component Anatomy & Structure” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Design Systems & Component Libraries lesson?
Yes. Every Design Systems & Component Libraries lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Atomic Design Methodology
- Component Anatomy & Structure
- Choosing Tech Stack Components
- Naming Conventions for Components