Skip to content

Styles

The Styles object holds visual properties for an element. Every property is optional. Which properties are evaluated depends on the element type.

type Styles = Partial<{ /* 48 properties */ }>;

Properties

Combined view: every style property, grouped by category and then by name, with the element-type categories it is evaluated for. container covers COMPONENT/FRAME/SLOT/INSTANCE; vectors covers RECTANGLE/VECTOR/ELLIPSE/STAR/POLYGON; text, glyph, and line cover their like-named element types.

CategoryNamecontainertextglyphvectorsline
BordercornerRadius
BordercornerSmoothing
BorderstrokeAlign
BorderstrokeWeight
ColorbackgroundColor
ColorfillColor
Colorstrokes
ColortextColor
Effectseffects
Layout (child)bottom
Layout (child)centerHorizontalOffset
Layout (child)centerVerticalOffset
Layout (child)end
Layout (child)layoutSizingHorizontal
Layout (child)layoutSizingVertical
Layout (child)position
Layout (child)start
Layout (child)top
Layout (parent)crossAxisAlignment
Layout (parent)itemReverseZIndex
Layout (parent)layoutMode
Layout (parent)mainAxisAlignment
Layout (parent)primaryAxisSizingMode
Layout (parent)wrap
Layout (parent)wrapAlignment
SizeaspectRatio
Sizeheight
SizemaxHeight
SizemaxWidth
SizeminHeight
SizeminWidth
Sizewidth
SpacingitemSpacing
Spacingpadding
TexttextAlignHorizontal
TexttextAlignVertical
Texttypography
Transformrotation
VisibilityclipContent
Visibilitylocked
Visibilityopacity
Visibilityvisible

Note on the vectors column. This column unions RECTANGLE with the vector-family element types (VECTOR, ELLIPSE, STAR, POLYGON), which share most styling but split on color: backgroundColor is evaluated only for RECTANGLE, while fillColor is evaluated only for the vector family. Both show ✓ under vectors here, but a given element of one subtype will only honor one or the other.

Key Mapping from Figma

Several spec style keys differ from the Figma node property they read from. Specs renames these to be more semantic and self-describing. Keys not listed here pass through unchanged (e.g. opacity reads node.opacity).

Spec keyFigma propertyADR
backgroundColorfillsADR 009
textColorfillsADR 009
fillColorfillsADR 013
wraplayoutWrapADR 039
wrapAlignmentcounterAxisAlignContentADR 039
mainAxisAlignmentprimaryAxisAlignItemsADR 040
crossAxisAlignmentcounterAxisAlignItemsADR 040
positionlayoutPositioningADR 041
topy (constraint MIN/STRETCH/SCALE)ADR 041
bottomy (constraint MAX/STRETCH)ADR 041
startx (constraint MIN/STRETCH/SCALE)ADR 041
endx (constraint MAX/STRETCH)ADR 041
centerHorizontalOffsetx (constraint CENTER)ADR 041
centerVerticalOffsety (constraint CENTER)ADR 041

All other style keys — width, height, opacity, padding, itemSpacing, cornerRadius, strokeWeight, rotation, etc. — use the same name as the Figma node property.

Values

Most properties accept a Style value. Some properties accept specialized shapes instead of or in addition to Style.

NameDescriptionExample
stringLiteral string value"HORIZONTAL"
numberLiteral number value16
booleanLiteral boolean valuetrue
nullAbsent or cleared valuenull
TokenReferenceReference to a design token{ $token: "DS.Space.400", $type: "dimension" }
PropBindingDynamic link to a prop value{ $binding: "#/props/label" }
ConditionalValue that depends on a prop’s state{ if: { condition: ..., then: 8, else: 12 } }
GradientValueLinear, radial, or angular gradient{ type: "LINEAR", angle: 90, stops: [...] }
TypographyText style object with individual properties{ fontSize: 14, fontFamily: "Inter" }
EffectsShadows and blurs{ shadows: [...], layerBlur: { ... } }
SidesPer-side values for padding or stroke weight{ top: 8, end: 12, bottom: 8, start: 12 }
CornersPer-corner values for corner radius{ topStart: 4, topEnd: 4, bottomEnd: 0, bottomStart: 0 }
ItemSpacingPer-axis gap values{ horizontal: 16, vertical: 8 }
LayoutModeAuto-layout direction enum"NONE", "HORIZONTAL", "VERTICAL"
WrapAlignmentWrap line distribution enum"START", "SPACE_BETWEEN"
MainAxisAlignmentMain axis alignment enum"START", "END", "CENTER", "SPACE_BETWEEN"
CrossAxisAlignmentCross axis alignment enum"START", "END", "CENTER", "STRETCH", "BASELINE"
PositionLayout positioning mode enum"AUTO", "ABSOLUTE"
PositionOffsetPositional offset value24 (px), "25%" (SCALE), null
AspectRatioWidth-to-height ratio{ x: 16, y: 9 }

Relating properties to values

  • Most properties accept any Style (literal, token, binding, or conditional).
  • backgroundColor, fillColor, strokes, textColor accept string | TokenReference | GradientValue | null.
  • typography accepts TokenReference | Typography.
  • effects accepts TokenReference | Effects.
  • padding, strokeWeight accept Style | Sides.
  • cornerRadius accepts Style | Corners.
  • itemSpacing accepts Style | ItemSpacing.
  • layoutMode accepts LayoutMode | null — not token-bindable.
  • wrapAlignment accepts WrapAlignment | null — not token-bindable.
  • mainAxisAlignment accepts MainAxisAlignment | null — not token-bindable.
  • crossAxisAlignment accepts CrossAxisAlignment | null — not token-bindable.
  • position accepts Position | null — not token-bindable.
  • top, bottom, start, end, centerHorizontalOffset, centerVerticalOffset accept PositionOffset (number | string | null) — not token-bindable.
  • aspectRatio accepts AspectRatio | null.