Components
Components Overview
PrimitiveKit provides 38 production-ready components organized into 6 categories. All components are fully accessible, customizable, and TypeScript-ready.
Quick Navigation
Form Components (10)
Build interactive forms with validation and accessibility:
| Component | Description |
|---|---|
| Button | Clickable button with variants and loading states |
| Input | Text input with validation and icons |
| Select | Dropdown selection with options |
| Checkbox | Checkbox input with labels |
| Radio | Radio button groups |
| Switch | Toggle switch for boolean values |
| Textarea | Multi-line text input with auto-resize |
| Slider | Range slider for numeric values |
| Form | Form wrapper with validation |
| Upload | File upload with drag-and-drop |
Layout Components (6)
Structure your pages with flexible layouts:
| Component | Description |
|---|---|
| Card | Content container with variants |
| Container | Responsive page container |
| Grid | CSS Grid layout system |
| Stack | Vertical/horizontal stacking |
| Space | Consistent spacing between elements |
| Divider | Visual content separator |
Feedback Components (5)
Provide user feedback and loading states:
| Component | Description |
|---|---|
| Alert | Alert messages with status variants |
| Badge | Status badges and labels |
| Spinner | Loading spinner indicator |
| Progress | Progress bar with animations |
| Skeleton | Loading content placeholder |
Navigation Components (6)
Help users navigate your application:
| Component | Description |
|---|---|
| Link | Styled link component |
| Breadcrumb | Breadcrumb navigation trail |
| Tabs | Tab navigation with panels |
| Menu | Navigation menu with nesting |
| Steps | Step indicator for processes |
| Pagination | Page navigation controls |
Overlay Components (5)
Display content in overlays and modals:
| Component | Description |
|---|---|
| Modal | Modal dialog with sizes |
| Drawer | Slide-out panel from edges |
| Tooltip | Hover tooltip with placement |
| Popover | Rich content popover |
| Dropdown | Dropdown menu with items |
Data Display Components (7)
Display data and content effectively:
| Component | Description |
|---|---|
| Avatar | User avatar with fallbacks |
| Tag | Removable tag labels |
| Table | Data table with sorting |
| Collapse | Collapsible content panels |
| Image | Image with loading states |
| Empty | Empty state placeholder |
| Typography | Text and heading components |
Component Features
🎨 Fully Customizable
Every component supports extensive CSS variable customization:
- 50-150+ CSS variables per component
- Component-level and global customization
- Design token integration
- Theme support
♿ Accessibility First
All components follow WCAG 2.1 AA standards:
- Proper ARIA attributes
- Keyboard navigation
- Screen reader support
- Focus management
- Touch target sizes (44x44px)
📘 TypeScript Support
Complete TypeScript definitions:
- Full prop type definitions
- CSS variable types
- Event handler types
- Generic component types
🎯 Design Tokens
Components use 600+ design tokens:
- Color scales
- Spacing system
- Typography scale
- Shadow system
- Border radius
- Animation timing
Getting Started
Installation
npm install @primitivekit/reactBasic Usage
import { Button, Input, Card } from '@primitivekit/react';
function App() {
return (
<Card>
<Input
label="Email"
type="email"
placeholder="Enter your email"
/>
<Button variant="primary" size="large">
Submit
</Button>
</Card>
);
}With Design Tokens
import '@primitivekit/react/tokens/tokens.css';
import { Button } from '@primitivekit/react';
function App() {
return (
<Button
style={{
'--btn-bg-color': 'var(--color-brand-primary-500)',
'--btn-border-radius': 'var(--border-radius-lg)',
'--btn-padding-x': 'var(--spacing-4)',
}}
>
Token-based Button
</Button>
);
}Component Patterns
Form Pattern
<Form onSubmit={handleSubmit}>
<Stack spacing="medium">
<Input label="Name" required />
<Input label="Email" type="email" required />
<Textarea label="Message" rows={5} />
<Button type="submit">Submit</Button>
</Stack>
</Form>Layout Pattern
<Container size="lg">
<Grid columns={{ base: 1, md: 2, lg: 3 }} gap="large">
<Card>Content 1</Card>
<Card>Content 2</Card>
<Card>Content 3</Card>
</Grid>
</Container>Modal Pattern
const [isOpen, setIsOpen] = useState(false);
<>
<Button onClick={() => setIsOpen(true)}>
Open Modal
</Button>
<Modal
isOpen={isOpen}
onClose={() => setIsOpen(false)}
title="Modal Title"
footer={
<>
<Button variant="outline" onClick={() => setIsOpen(false)}>
Cancel
</Button>
<Button onClick={handleConfirm}>
Confirm
</Button>
</>
}
>
<p>Modal content</p>
</Modal>
</>Next Steps
- Browse individual component documentation
- Learn about customization
- Explore design tokens
- Check accessibility guidelines
- View examples and patterns