Design System
The @leadline-inc/design-system package — Ant Design, atomic design, and usage notes
@leadline-inc/design-system
Component Library
Atomic Design
The @leadline-inc/design-system is a comprehensive component library that provides a cohesive set of reusable UI components for building consistent and scalable user interfaces. This library is architecturally designed following the Atomic Design Pattern, ensuring a systematic and hierarchical approach to component organization.
Architecture Overview
Our design system follows the Atomic Design methodology, creating a clear hierarchy of components that promotes reusability, maintainability, and consistency across all applications.
Foundation: Ant Design
The @leadline-inc/design-system is built upon the robust foundation of Ant Design (antd), one of the most comprehensive and battle-tested React UI libraries. By inheriting from Ant Design, our system benefits from:
- Proven Components: Battle-tested components used by millions of developers worldwide
- Comprehensive Feature Set: Rich functionality including advanced form handling, data visualization, and complex interactions
- Accessibility Standards: Built-in accessibility features and ARIA compliance
- Internationalization: Multi-language support and RTL layout capabilities
- Design Language: Consistent design principles and visual guidelines
Ant Design provides the foundational layer, while our atomic design structure organizes and extends these components into a cohesive system tailored for our specific needs.
Atomic Design Layer
On top of the Ant Design foundation, we apply the Atomic Design methodology to create a systematic approach to component organization and usage.
The Atomic Design Pattern was introduced by Brad Frost and provides a methodology for creating design systems with a clear hierarchy of components.
Atomic Design Pattern
The Atomic Design Pattern is a methodology for creating design systems that breaks down user interfaces into their basic building blocks. It uses the analogy of chemistry, where atoms combine to form molecules, which combine to form organisms, and so on.
The Five Levels of Atomic Design
Atoms
Basic building blocks - buttons, inputs, labels, icons The smallest functional units that can't be broken down further without losing their meaning.
Molecules
Simple combinations - search forms, navigation items Groups of atoms bonded together to perform a specific function.
Organisms
Complex components - headers, footers, product lists Groups of molecules joined together to form distinct interface sections.
Templates
Page-level objects - wireframes, layout structures Page-level objects that place components into a layout and articulate the design's underlying content structure.
Pages
Specific instances - actual content, real data Specific instances of templates that show what a UI looks like with real content.
Key Principles
Hierarchical Organization
Components are organized in a clear hierarchy from simple to complex, making it easy to understand relationships and dependencies.
Atoms → Molecules → Organisms → Templates → PagesReusability and Consistency
- Single Source of Truth: Each component has one canonical implementation
- Consistent Behavior: Components behave the same way across different contexts
- Scalable Architecture: Easy to extend and maintain as the system grows
Modular Design
Each component is self-contained and can be used independently or combined with others to create more complex interfaces.
Design Token Integration
The system leverages design tokens for:
- Colors and theming
- Typography scales
- Spacing and sizing
- Border radius and shadows
- Animation timings
Design tokens ensure visual consistency and make it easy to implement design changes across the entire system.
Component Categories in @leadline-inc/design-system
Atoms
Button
Basic interactive element with variants for primary, secondary, and tertiary actions.
Input
Form input fields with validation states and accessibility features.
Icon
Scalable vector icons with consistent sizing and theming.
Label
Text labels with typography hierarchy and semantic meaning.
Molecules
Form Field
Combination of label, input, and help text for form construction.
Search Box
Input field combined with search icon and submit functionality.
Button Group
Multiple buttons working together for related actions.
Organisms
Navigation
Complete navigation system with menus, links, and user actions.
Data Table
Complex table component with sorting, filtering, and pagination.
Modal Dialog
Complete modal system with overlay, content area, and actions.
Benefits of This Approach
For Developers
- Faster Development: Pre-built components reduce development time
- Consistent APIs: Similar components have similar interfaces
- Better Testing: Components are tested in isolation and combination
- Easy Maintenance: Changes propagate through the system automatically
For Designers
- Design Consistency: Ensures visual and interaction consistency
- Efficient Workflow: Design once, use everywhere
- Clear Guidelines: Atomic structure provides clear usage guidelines
- Scalable System: Easy to extend with new components
For Product Teams
- Faster Iteration: Quick prototyping with existing components
- Consistent UX: Users get familiar patterns across products
- Reduced Bugs: Well-tested components reduce interface issues
- Cost Effective: Less duplicate work across teams
Implementation Best Practices
Component Composition
// Building complex interfaces by composing atoms and molecules
<SearchForm>
<FormField>
<Label>Search Query</Label>
<Input placeholder="Enter search terms..." />
<HelpText>Use quotes for exact matches</HelpText>
</FormField>
<Button variant="primary" type="submit">
<Icon name="search" />
Search
</Button>
</SearchForm>Consistent Theming
All components inherit from a central theme configuration, ensuring consistency across the entire system.
Accessibility First
Every component is built with accessibility in mind, including:
- Proper ARIA attributes
- Keyboard navigation support
- Screen reader compatibility
- Color contrast compliance
The @leadline-inc/design-system follows WCAG 2.1 AA guidelines to ensure
accessibility for all users.
Getting Started
To start using the design system in your project:
-
Install the package
pnpm add @leadline-inc/design-system -
Import components
import { Button, Input, Card } from "@leadline-inc/design-system"; -
Follow the atomic principles
- Start with atoms for basic elements
- Combine into molecules for functionality
- Build organisms for complex sections
- Create templates for page layouts
The atomic design approach ensures that your application maintains consistency while providing the flexibility to create unique and engaging user experiences.
