Figma
Platform binding for the Specs document format — draft.
Normative frame: SPECIFICATION.md §11. This document states how
the Figma binding realises the schema; it does not restate what the members mean —
that is the reference at /schema.
Generated from mappings/bindings/figma.json by scripts/build-mappings.mjs.
Edit the binding file, never this page.
Rules
The rules that resolve jointly — where no single key or kind determines any single output, the rule’s ordered case table IS the mapping, on its own page. Keys and kinds in the surface tables below link back here through their rule column.
| Rule | Surface | Keys |
|---|---|---|
| primitivePromotion | Anatomy | text, glyph, instance |
| typeDetection | Anatomy | text, glyph, vector, container, line, ellipse, rectangle, polygon, star |
| wrapperCollapse | Anatomy | container, text, glyph |
| booleanContentPairing | Props | boolean |
| codeOnlyProps | Props | image |
| numberInference | Props | string, number |
| variantAxes | Props | boolean, enum, number |
| autoVsAbsoluteLayout | Styles | position, top, bottom, start, end, centerHorizontalOffset, centerVerticalOffset, layoutSizingHorizontal, layoutSizingVertical, width, height |
| namedStyleVersusInline | Styles | typography |
| wrapping | Styles | wrap, wrapAlignment, itemSpacing, layoutMode, mainAxisAlignment, crossAxisAlignment |
Styles
44 bound, 2 approximated, 2 unsupported, of 48 style keys.
A key whose row says rule does not map on its own — its rule is a case table on the rule’s own page. Writing a per-key mapping for it would be false, not merely incomplete.
| Disposition | Keys | Meaning |
|---|---|---|
bound | 44 | Realised, and confirmed against the implementation |
approximated | 2 | Realised with loss, and the loss is stated |
unsupported | 2 | Declared as not realised, with the resulting behaviour stated |
Every row below is a claim a reader may rely on.
| Style key | Disposition | Realised by |
|---|---|---|
aspectRatio | bound | node.targetAspectRatio |
backgroundColor | bound | node.fills |
bottom | bound | rule autoVsAbsoluteLayout |
centerHorizontalOffset | bound | rule autoVsAbsoluteLayout |
centerVerticalOffset | bound | rule autoVsAbsoluteLayout |
clipsContent | bound | node.clipsContent |
cornerRadius | bound | node.cornerRadius |
cornerSmoothing | bound | CornerStyle.applySmoothing |
effects | bound | Effects.apply |
end | bound | rule autoVsAbsoluteLayout |
fillColor | bound | node.fills |
height | bound | rule autoVsAbsoluteLayout |
itemReverseZIndex | bound | node.itemReverseZIndex |
itemSpacing | bound | rule wrapping |
layoutMode | bound | rule wrapping |
layoutSizingHorizontal | bound | rule autoVsAbsoluteLayout |
layoutSizingVertical | bound | rule autoVsAbsoluteLayout |
locked | bound | node.locked |
mainAxisAlignment | bound | rule wrapping |
maxHeight | bound | node.maxHeight |
maxLines | bound | node.maxLines |
maxWidth | bound | node.maxWidth |
minHeight | bound | node.minHeight |
minWidth | bound | node.minWidth |
opacity | bound | node.opacity |
padding | bound | node.paddingTop / paddingRight / paddingBottom / paddingLeft |
position | bound | rule autoVsAbsoluteLayout |
primaryAxisSizingMode | bound | node.primaryAxisSizingMode |
rotation | bound | node.rotation |
start | bound | rule autoVsAbsoluteLayout |
strokeAlign | bound | node.strokeAlign |
strokeDashPattern | bound | node.dashPattern |
strokes | bound | node.strokes |
strokeWeight | bound | node.strokeWeight |
textAlignHorizontal | bound | node.textAlignHorizontal |
textAlignVertical | bound | node.textAlignVertical |
textColor | bound | node.fills |
textOverflow | bound | node.textTruncation |
top | bound | rule autoVsAbsoluteLayout |
typography | bound | rule namedStyleVersusInline |
visible | bound | node.visible |
width | bound | rule autoVsAbsoluteLayout |
wrap | bound | rule wrapping |
wrapAlignment | bound | rule wrapping |
backgroundImage | approximated | node.fills |
crossAxisAlignment | approximated | rule wrapping |
gridColumns | unsupported | rule wrapping |
gridRows | unsupported | rule wrapping |
Props
A prop is declared once in the spec and realised differently by kind on each platform. Unlike a style key, a kind may carry its own row and be governed by a rule — a kind is a population of props, and different populations of it resolve differently.
| Prop kind | Disposition | Realised by |
|---|---|---|
boolean | bound | ComponentPropertyDefinitions (BOOLEAN, or a two-option VARIANT) · rule variantAxes |
enum | bound | VARIANT property options / ComponentSet variant axes · rule variantAxes |
image | bound | code-only container layer named in figma.images.sourceProps“ · rule codeOnlyProps |
number | bound | TEXT default or all-numeric VARIANT options, under platforms.figma.inferNumberProps“ · rule variantAxes |
object | bound | separator-delimited flat property names, under platforms.figma.objectProps“ |
slot | bound | ComponentPropertyDefinitions (SLOT), plus slotSettings and preferredValues |
string | bound | ComponentPropertyDefinitions (TEXT or INSTANCE_SWAP) · rule numberInference |
Anatomy
An anatomy element’s names are the library’s; its TYPE is the contract’s, and the type is what each platform realises. A type may carry its own row and be governed by a rule — a type is a population of elements, and which type a node even becomes is itself a joint rule.
| Element type | Disposition | Realised by |
|---|---|---|
container | bound | FRAME or COMPONENT node · rule typeDetection |
ellipse | bound | ELLIPSE node · rule typeDetection |
glyph | bound | INSTANCE or VECTOR reclassified by the library's glyphs convention · rule typeDetection |
instance | bound | INSTANCE node |
line | bound | LINE node · rule typeDetection |
rectangle | bound | RECTANGLE node · rule typeDetection |
slot | bound | SLOT node |
text | bound | TEXT node · rule typeDetection |
polygon | approximated | POLYGON node · rule typeDetection |
star | approximated | STAR node · rule typeDetection |
vector | approximated | VECTOR node · rule typeDetection |
Values and References
What a platform does with each form a VALUE may take — the scalar forms (a
literal, the mixed sentinel) and the pointer grammar (SPECIFICATION §5.1’s six
reserved-marker forms plus the $nested paths; DSPEC-42 for the style-value half).
The set is closed: the safe key grammar admits no authored $-prefixed key, so no
document can mint a new marker. Notes stay inline — the forms’ reference pages are
hand-written and carry no generated binding section yet.
| Reference form | Disposition | Realised by | Notes |
|---|---|---|---|
binding | bound | component property bindings | Capture writes a $binding wherever a Figma property drives an element member — content, visible, instanceOf. Render re-creates the property and re-attaches the binding by the id map the property pass returns; on a style value, the dedicated binding path wires the node field to the component property, not yet confirmed per key. |
conditional | bound | render-path conditional evaluation | The ADR-018 conditional form is implemented on the render path: the condition’s binding target is resolved dynamically and the then/else branch applied. The one platform that honours it; not yet confirmed per key. |
image | bound | image fills and the images registry | Capture deduplicates image bytes into the registry and writes $image pointers (ADR-063); render restores fills and source layers from the registry. |
literal | bound | node properties, directly | The ordinary case for every style value. |
slotContent | bound | nested instances and override subtrees | Capture deduplicates structured fills into the registries by structural equality and writes $slotContent pointers at the fill sites; render composes nested instances through the instance manifests. |
subcomponent | bound | sibling components in one component set or file | A $ref into #/subcomponents/ captures from and renders back to the sibling component the pattern match identified. |
theme | bound | explicitVariableModes / setExplicitVariableModeForCollection | A token group is a variable collection and a theme is one of its modes. Capture reads a node’s own mode selections, never the resolved set its ancestors contribute to, which is what records a selection where it was made (DSPEC-74); render applies each selection to the collection the group names and clears it where the value is null. Group names are resolved against the variable collections the caller declares it holds, matched id then published key then name, and a collection that matches none is omitted and reported rather than recorded under the name the file answers with (DSPEC-80) — a file reports a renamed collection’s retired name, and a collection no held library publishes, with equal confidence. A caller that declares nothing is unfiltered. |
token | bound | Figma Variables | Capture records the bound variable as a $token; render resolves the token path back to a variable and binds it. Where the variable cannot be resolved, the value falls back to the cached raw value the document carries — a degradation using only data the document holds (DSPEC-43). |
nested | approximated | nested instance overrides | Capture writes $nested paths for configuration deeper than one instance boundary (ADR-052). Render declares them unimplemented and skips them, reporting the skip — a stated loss, not a silent one. |
elementType | unsupported | — | Never produced: capture writes plain ElementType strings. An authored ElementTypeRef passes through opaque — resolution is a consumer concern by design (ADR-012). |
mixed | unsupported | — | Nothing is applied. A mixed value records that the source layer had no single value, so there is nothing to render and a rendered guess would be invented data. The sentinel is a defect signal about the Figma file, not a value a binding realises. |
Defaults
What an absent style key means is spec-level, not per-platform: two platforms that answer differently disagree about what the same document says. It is declared once in the schema — each style key’s page marks its own default — and the ambiguity absence carries is stated on the Overview.
What this platform does on absence is its own fact, and is recorded per key below.
A key whose behaviour is not declaredDefault disagrees with the contract — visibly,
and as a decision rather than an accident.
| Behaviour | Keys | Meaning |
|---|---|---|
unverified | 48 | Nobody has established what this platform does when the key is absent. |
Losses
What this platform does is settled and stated above. Where a loss is real, its acceptability is a product question rather than a specification’s to settle alone. 8 of 48 keys raise one of 4 such questions, of which 2 remain open.
- A value is dropped rather than degraded. Affects
backgroundImage. A gradient whose stops do not yield two resolvable colours is dropped whole. Apaddingside that is present but unresolvable is omitted while its siblings emit, whereascornerRadiussubstitutes0for the same failure. DSPEC-43 says a degradation applies the spec’s own recorded fallback, or applies nothing and warns — dropping part of a value silently is neither. Open. See #816 on the disagreement between the composite types, and #815 on the gradient path. - Zero is not distinguishable from unset. Affects
minWidth,minHeight. Both platforms currently treat a dimension of 0 as “no constraint” rather than “a constraint of zero”. Open. Deferred — see #814, and #812 on what an absentwidth/heightmeans. The two interact and should be settled together. - A non-sRGB ColorObject renders as if it were sRGB. Affects
backgroundColor,fillColor,textColor,strokes. The schema admits 14 colour spaces and the render path never readscolorSpace— components 0 through 2 are taken as red, green and blue regardless, so anoklchvalue is misread rather than approximated. Anonecomponent becomes 0, and components beyond the third are dropped. Decided. Convert to sRGB at render time (#813). The schema keeps all 14 spaces; the render path gains a conversion with gamut mapping for values outside sRGB. Until that lands, a non-sRGB ColorObject renders wrong rather than degraded. - Logical sides become physical without a direction. Affects
padding. The schema usesstartandendso a document is direction-agnostic. The Figma render mapsstartto the left padding with no writing-direction branch. Decided. Accepted as a platform limit. Figma cannot express a writing direction, so the mapping is left-to-right only and the loss is declared rather than fixed — which is whatapproximatedmeans. CSS stays direction-safe by emittingpadding-blockandpadding-inline.