Skip to content

Theme API Reference

Theme is core to the component system. It is used to style the components and provide a consistent look and feel to your app.

PresetColorsTypographyComponents
systemSystem defaultDefaultDefault
lightLight theme colorsDefaultDefault
darkDark theme colorsDefaultDefault

Main theme object containing all styling configurations.

PropertyTypeDescription
colorsThemeColorsColor palette configuration
fontSizesThemeFontSizesFont size scale
spacingThemeSpacingSpacing scale
componentsThemeComponentSizesComponent-specific sizing
typographyThemeTypographyText style presets

Color palette for the theme system.

PropertyTypeDescription
primarystringPrimary brand color
secondarystringSecondary brand color
backgroundstringMain background color
surfacestringSurface/card background color
textstringPrimary text color
textSecondarystringSecondary text color
borderstringBorder color
errorstringError state color
warningstringWarning state color
successstringSuccess state color
infostringInfo state color
mutedstringMuted/disabled color
accentstringAccent color
destructivestringDestructive action color

Font size scale for consistent typography.

PropertyTypeDescription
xsnumberExtra small font size
smnumberSmall font size
mdnumberMedium font size (base)
lgnumberLarge font size
xlnumberExtra large font size
xxlnumberExtra extra large font size

Spacing scale for consistent layout.

PropertyTypeDescription
xsnumberExtra small space
smnumberSmall space
mdnumberMedium space
lgnumberLarge space
xlnumberExtra large space
xxlnumberExtra extra large space

Component-specific sizing configurations.

PropertyTypeDescription
heightComponentHeightHeight sizes for components
paddingComponentPaddingPadding sizes for components
borderRadiusComponentBorderRadiusBorder radius sizes
PropertyTypeDescription
xsnumberExtra small height
smnumberSmall height
mdnumberMedium height
lgnumberLarge height
xlnumberExtra large height
PropertyTypeDescription
xsnumberExtra small padding
smnumberSmall padding
mdnumberMedium padding
lgnumberLarge padding
xlnumberExtra large padding
PropertyTypeDescription
xsnumberExtra small border radius
smnumberSmall border radius
mdnumberMedium border radius
lgnumberLarge border radius
xlnumberExtra large border radius
fullnumberFull border radius (circular)

Predefined text styles for consistent typography.

PropertyTypeDescription
captionTextStyleCaption text style
smallTextStyleSmall text style
bodyTextStyleBody text style
subtitleTextStyleSubtitle text style
titleTextStyleTitle text style
headingTextStyleHeading text style

Each typography style contains:

  • fontSize: Font size value
  • lineHeight: Line height value
  • fontWeight: Font weight value

Custom theme configuration factory function.

TypeReturnDescription
(isDark: boolean) => CustomThemeConfigCustomThemeConfigCustom font size scale

CustomThemeConfig is a type alias that extends the base Theme interface, allowing you to customize and override the default theme configuration while maintaining type safety and consistency across your application.