Overview
WhileTheme.Provider offers pre-built themes, CustomizationProvider enables you to:
- Override specific design tokens
- Customize individual component styles using element names
- Create brand-specific variations
- Merge custom tokens with base themes
Installation
Basic Usage
Props
baseTheme
- Type:
'default' | 'dark' - Default:
'default'
theme
- Type:
Partial<GenericThemeShape>
elements
- Type:
{ [key: string]: PasteCustomCSS }
customBreakpoints
- Type:
string[]
disableAnimations
- Type:
boolean - Default:
false
Theme Overrides
Typography
Customize fonts, sizes, and weights:Colors
Override background, text, and border colors:Spacing & Sizing
Adjust spacing scale and component sizes:Borders & Shadows
Customize border radii, widths, and shadows:Element Customization
Each Paste component exposes element names for granular styling.Button Customization
Input Customization
Card Customization
Multiple Elements
Customize multiple components at once:Style Props in Elements
Elements support all Paste style props:Advanced Patterns
Brand-Specific Theme
Nested Customization
Apply different customizations to different sections:Conditional Customization
Finding Element Names
To customize a component, you need its element name. Each component’s documentation includes its element names, or you can:- Check the component’s Props table
- Inspect the rendered HTML
data-paste-elementattribute - Review the component’s source code
BUTTON,INPUT,TEXTAREA,SELECTCARD,HEADING,PARAGRAPH,TEXTALERT,MODAL,POPOVER,TOOLTIPBOX(used by many components internally)
Best Practices
- Start with base theme: Always extend a base theme rather than defining everything from scratch
- Use design tokens: Reference theme tokens in element customizations instead of hardcoded values
- Test variants: Ensure customizations work across all component variants
- Maintain accessibility: Don’t override colors in ways that reduce contrast
- Document customizations: Keep track of which elements you’ve customized and why
Limitations
- Element names are case-sensitive
- Duplicate element names (even with different casing) will throw an error
- Some internal component styles may not be customizable
- Custom CSS should use Paste tokens for consistency
Next Steps
- Explore Design Tokens to understand available values
- Learn about Style Props for element customization
- Try the Theme Designer tool
- Read about Creating Custom Themes