Installation
You can install presets in two ways:Install the Presets Package
The@theme-ui/presets package includes all available presets:
Install Individual Preset Packages
You can also install individual preset packages to reduce bundle size:Basic Usage
To use a preset, spread it into your theme configuration:Customizing Presets
Presets are designed to be customized. You can override any part of a preset to match your design requirements.Override Specific Values
You can override individual values while keeping the rest of the preset:Override Fonts
Change the font families while keeping other preset values:Add Custom Styles
Extend the preset’s styles with your own:Add Custom Variants
Add your own component variants while keeping preset styles:Extending Presets
You can build on top of presets by importing them in your own preset files.Extend from Base
Many Theme UI presets extend from thebase preset:
Merge Multiple Presets
You can combine values from multiple presets using deepmerge or object spreading:The
merge function from Theme UI performs a deep merge of theme objects, which is useful when combining presets.Create a Custom Preset
You can create your own reusable preset:Color Modes with Presets
Some presets likesystem include built-in color modes. You can also add color modes to any preset:
Best Practices
Start with a Preset
Using a preset is a great way to get started quickly. Choose one that closely matches your design aesthetic:- For a minimal starting point: use
base - For dark themes: use
darkordeep - For comprehensive design systems: use
tailwindorbootstrap - For unique aesthetics: try
funk,swiss, orsketchy
Customize Gradually
Don’t override everything at once. Start with the preset and gradually customize:- Use the preset as-is initially
- Adjust colors to match your brand
- Customize typography if needed
- Add custom component variants
- Fine-tune spacing and sizing
Keep Your Overrides Organized
Organize your theme customizations in a logical structure:Use TypeScript
For better autocompletion and type safety, use TypeScript:Examples
Minimal Customization
Just change the colors:Extensive Customization
Override multiple aspects:Combining Preset Features
Mix colors from one preset with styles from another:Next Steps
Presets Overview
Explore all available presets
Theming
Learn about the theme specification
Color Modes
Add dark mode and color modes
Components
Build UI with Theme UI components
