@theme-ui/components package provides a complete set of primitive UI components that work seamlessly with your theme. All components support the sx prop and can be styled using theme values.
Installation
This package is included in the main
theme-ui package, so a separate installation is not required if you’re already using theme-ui.When to Use
Use@theme-ui/components when you:
- Need pre-built, theme-aware UI components
- Want consistent styling across your application
- Are building with design system constraints
- Need accessible, well-tested primitives
theme-ui package if you also need the provider and other utilities.
All Components
Layout Components
Box
The foundational layout component. All other components are built on top of Box.
Flex
A Box with display: flex.
Grid
A Box with display: grid.
Container
A centered container with max-width.
Typography Components
Text
General purpose text component.
Heading
Heading component with automatic variant mapping.
Paragraph
Paragraph component.
Link
Styled link component.
Form Components
Button
Button component with theme variants.
Input
Text input field.
Textarea
Multi-line text input.
Select
Dropdown select component.
Label
Form label component.
Checkbox
Checkbox input.
Radio
Radio button input.
Slider
Range slider input.
Switch
Toggle switch component.
Field
Combines Label and Input/Textarea/Select.
Interactive Components
IconButton
Button optimized for icons.
MenuButton
Button with menu icon.
Close
Close button component.
NavLink
Navigation link with active state support.
Display Components
Card
Card container component.
Image
Image component.
Avatar
User avatar component.
Badge
Badge component for labels and counts.
Alert
Alert message component.
Message
Message box component.
Divider
Horizontal divider.
Media Components
Embed
Responsive iframe embed.
AspectRatio
Container that maintains aspect ratio.
AspectImage
Image with aspect ratio constraint.
Feedback Components
Progress
Progress bar component.
Donut
Circular progress indicator.
Spinner
Loading spinner component.
Complete Component List
Common Features
All components support:The sx Prop
Style components with theme-aware values:
Variants
Apply pre-defined style variants from your theme:Responsive Props
Many components support responsive prop values:TypeScript Support
All components are fully typed:Notes
- All components use the
sxprop for styling - Components forward refs correctly
- Fully accessible with ARIA attributes
- Built with styled-system for consistent API
- Requires
@emotion/reactandreactas peer dependencies - Requires
@theme-ui/theme-provideras a peer dependency
Related
- @theme-ui/core - Core Theme UI functionality
- Components - Full component documentation
- Theming - Customizing component styles
