Skip to content

Prop extensions

The $extensions object on a prop definition holds vendor-specific metadata under reverse-domain keys. Currently only the com.figma extension is defined. Extension data is provenance — a consumer MUST NOT need it to interpret the prop (the spec contract carries everything semantic), and the render direction reads it to reverse what capture recorded.

Path

component-api:props.<prop>.$extensions — on every prop kind.

PropExtensions

DTCG §5.2.3 platform-specific extensions for prop definitions. Each property is a reverse-domain key whose value is a platform extension type.

MemberTypeRequiredDescription
com.figmaFigmaPropExtensionNo
com.figma:
type: VARIANT
name: Variant

FigmaPropExtension

DTCG §5.2.3 Figma-specific metadata for a prop definition.

MemberTypeRequiredDescription
typeunknownNoFigma-native property type
sourceFigmaCodeOnlySourceNoProvenance metadata — present only for props extracted from a code-only container layer
namestringNoThe Figma component-property name (ADR-066).
type: VARIANT
name: Size

FigmaCodeOnlySource

Provenance metadata for props extracted from a Figma code-only container layer.

MemberTypeRequiredDescription
kind'codeOnlyProp'YesDiscriminator identifying this prop as originating from a code-only container
layerstringYesSub-layer name within the code-only container tree corresponding to this prop
instanceOfstringNoFor enum code-only props: the component name of the nested instance whose variants define the enum values
kind: codeOnlyProp
layer: Code only props

Scenarios

Every shape below is one specs generate actually writes, keyed by what produced it. A prop may combine them — name joins whatever else the prop’s extraction recorded.

A two-option VARIANT read as a boolean. The axis’s options were exactly true/false, so the prop is a BooleanProp; the recorded type is what tells render to rebuild a variant axis rather than a BOOLEAN property.

isCompact:
type: boolean
default: false
$extensions:
com.figma:
type: VARIANT

A consolidated visibility pair. A BOOLEAN property only ever toggled the element this content prop fills, so the boolean was consumed into the content prop’s nullability and named here — render re-creates it. The value is the Figma property’s own name, verbatim: capitalisation and spacing as the component set spells it, never a formatted key, because render looks the property up by that string.

badgeLabel:
type: string
nullable: true
default: null
$extensions:
com.figma:
visibilityProp: Badge visible

A code-only prop from a hidden TEXT layer. String- or number-valued; source names the sub-layer so render can mint the hidden layer back.

headingLevel:
type: number
default: 2
$extensions:
com.figma:
type: TEXT
source:
kind: codeOnlyProp
layer: headingLevel

A code-only enum from a nested instance. The nested component’s variant options define the enum values, and instanceOf names which component — a two-option true/false instance mints a boolean through the same shape.

role:
type: string
default: status
enum: [status, alert, log]
$extensions:
com.figma:
type: VARIANT
source:
kind: codeOnlyProp
layer: role
instanceOf: RoleOptions

A code-only image prop. Minimal by design (ADR-063): the authoring-default image rides on the ImageBinding at the binding site, not here.

imageSource:
type: image
$extensions:
com.figma:
type: TEXT
source:
kind: codeOnlyProp
layer: imageSource

A key the formatting could not reconstruct (ADR-066). The Figma property name fell outside the safe key grammar — or was already in the destination format — so name records it and reversal is a lookup, not a re-derivation.

showIcon:
type: boolean
default: true
$extensions:
com.figma:
name: "Show icon?"

A folded object-prop member (ADR-111). Each member records the separator-delimited flat property name it folded from; the parent ObjectProp records nothing — it has no Figma counterpart of its own.

margin:
type: object
members:
compact:
type: string
default: none
enum: [none, small, large]
$extensions:
com.figma:
name: margin.compact

Decisions

  • ADR-027 — Code-Only Props
  • ADR-066 — Lossless key formatting — safe key grammar and Figma name preservation

Source

FormatFile
JSON Schemapackages/schema/schema/component.schema.json
TypeScriptpackages/schema/types/Props.ts
Specification§4.2, §11