Skip to main content
Theme UI follows the System UI Theme Specification, which defines standard scales and conventions for theme objects. This specification enables themes to be interoperable across different libraries and tools.

Theme Interface

The complete Theme type definition:

Scale Type

Scales can be defined as arrays or objects:

Required vs Optional Fields

All theme properties are optional. Theme UI provides sensible defaults:

Color Modes Scale

The colors scale has special support for color modes:
Example:

Configuration Object

The config object controls Theme UI behavior:
Example:

Theme Styles

The styles object defines base element styles:
Example:

Scale Conventions

Space Scale Convention

Use powers of two or a consistent rhythm:

Font Size Scale Convention

Define a typographic scale:

Color Scale Convention

Organize colors by purpose:

Nested Scales

Nested scales allow grouping related values:
The __default key is used when accessing the parent:

Component Variants

Component variants are reusable style objects:

Breakpoints

Breakpoints define responsive design boundaries:
Use with responsive arrays:
Following the Theme Specification ensures your themes work consistently across different Theme UI applications and can be shared or extended easily.