Skip to content

Props

Props define the configurable inputs of a component. Each prop has a type, a default value, and optional extensions.

type Props = Record<string, AnyProp>;
type AnyProp = BooleanProp | StringProp | EnumProp | NumberProp | SlotProp;

Prop Kinds

BooleanProp

PropertyTypeRequiredDescription
type'boolean'Yes
defaultbooleanYesDefault value
$extensionsPropExtensionsNoVendor extensions

EnumProp

PropertyTypeRequiredDescription
type'string'Yes
defaultstringYesDefault value (must be in enum)
enumstring[]YesAllowed values
nullablebooleanNoWhether null is a valid value
$extensionsPropExtensionsNoVendor extensions

StringProp

PropertyTypeRequiredDescription
type'string'Yes
defaultstring | nullNoDeprecated — use examples
nullablebooleanNoWhether null is a valid value
examplesstring[]NoExample values
$extensionsPropExtensionsNoVendor extensions

A StringProp is distinguished from an EnumProp by the absence of enum.

NumberProp

PropertyTypeRequiredDescription
type'number'Yes
defaultnumberNoDefault value
examplesnumber[]NoExample values

Inferred from Figma variant values when inferNumberProps is enabled.

SlotProp

PropertyTypeRequiredDescription
type'slot'Yes
defaultstring | nullNoDefault slot content
nullablebooleanNoWhether null is a valid value
minItemsnumberNoMinimum number of items (since 0.14.0)
maxItemsnumberNoMaximum number of items (since 0.14.0)
anyOfstring[]NoPermitted component type names (since 0.14.0)
$extensionsPropExtensionsNoVendor extensions

Slot constraint properties (minItems, maxItems, anyOf) are emitted when slotConstraints is enabled in config.

Extensions

The $extensions object holds vendor-specific metadata. Currently only the com.figma extension is defined.

FigmaPropExtension

PropertyTypeDescription
typestringFigma property type (e.g. BOOLEAN, TEXT, INSTANCE_SWAP, VARIANT)
sourceFigmaCodeOnlySourcePresent when the prop originates from a code-only prop layer

FigmaCodeOnlySource

PropertyTypeDescription
kind'codeOnlyProp'Always 'codeOnlyProp'
layerstringSub-layer name in the code-only container
instanceOfstringComponent name, for enum code-only props

Further Reading