Skip to main content

Design token keys

Look up the keys of the tokens object you pass to registerDesignTokens, and what each key takes. You need it when you write the object and aren't sure which group a value belongs to. For the options argument, see Choose how strict the Design tab is.

The example on this page is the Blog project. It registers colorTokens, spaceTokens, size and typography tokens.

Global design tokens​

Global tokenWhere it appears in the Design tab
colorTokensThe color controls of Typography, Background, Border and Shadow.
spaceTokensSpacing margin and padding, and the Layout gap.

spaceTokens don't appear in the Size controls. For those, use size.tokens. TypeScript requires a unit on every length, such as 8px or 0.5rem.

Section design tokens​

Section tokens cover twelve groups. Register only the groups your design system defines.

SectionWhat it takes
sizewidth, height, minWidth, minHeight, maxWidth, maxHeight, and tokens to set all six at once.
spacingmargin, padding, tokens for both, and style presets that set margin and padding together.
positionzIndex and position.
visibilityopacity as a percentage.
layoutgap.
typographycolor, fontWeight as numbers, fontSize, lineHeight, letterSpacing, and style presets that can include a fontFamily.
backgroundcolor, and style presets: solid color, linear gradient, radial gradient or image.
shadowcolor, and style presets with x, y, blur, spread, color and inset. Studio builds the CSS value.
effectsfilter.
bordercolor, radius and style presets.
transformstyle presets.
overflowstyle presets.

To register tokens with these keys, see Register design tokens.

Report a problem with this page