Skip to content

React

Platform binding for the Specs document format — draft.

Normative frame: SPECIFICATION.md §11.

Inherits from CSS

Emits React components and stories. Styling is delegated wholly to the CSS binding.

Every style key is bound exactly as the CSS binding states, unless overridden below. This binding never restates an inherited mapping: a second copy of a rule is a second thing to keep true.

Rules

The rules that resolve jointly on this platform’s own surfaces — props and anatomy are never inherited, so these are this binding’s own. Each rule’s ordered case table is its own page.

RuleSurfaceKeys
layoutWalkAnatomycontainer, text, glyph, instance, slot
semanticsAndTagsAnatomytext, container, instance
slotsToChildrenPropsslot
statesToContractPropsboolean, enum

Style overrides

None. Every style key is inherited unchanged.

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 kindDispositionRealised by
booleanbounda boolean member of the component’s Props interface · rule statesToContract
enumbounda named union type, one member per enum value · rule statesToContract
imagebounda nullable string URL member of the Props interface
numberbounda number member of the Props interface
objectbounda named member interface; values as object literals
slotboundchildren, or a named prop of React.ReactNode · rule slotsToChildren
stringbounda string member of the Props interface, nullable-widened with null

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 typeDispositionRealised by
containerbounda div — or the tag its role decides · rule semanticsAndTags
instanceboundthe composed component, imported and configured · rule semanticsAndTags
rectanglebounda styled div
slotboundthe fill render site — children for the default slot, the named prop otherwise
textbounda span carrying the element’s content · rule semanticsAndTags
ellipseapproximateda fully-rounded div
glyphapproximatedan aria-hidden span painted by CSS mask
lineapproximateda styled div
vectorapproximateda styled div occupying the vector’s box
polygonunsupporteda styled div — box only, no shape
starunsupporteda styled div — box only, no shape

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 formDispositionRealised byNotes
bindingboundprop access on the component — p.<key>, member pointers through member accessA $binding at a content, instanceOf or configuration site reads the bound prop at render; a member pointer (#/props/x/members/y, ADR-111) reads through the object prop. An image-bearing binding emits its authoring-default example as the fallback (ADR-063/088).
imagebounda served asset URLAn $image pointer resolves to the registry entry’s served URL at emit — in props, configurations, and composed content alike.
literalboundthrough the CSS binding’s stylesheetStyle values are the CSS binding’s; the emitter never reads them.
slotContentboundrecursive JSX composition from the registriesA $slotContent pointer resolves its registry entry and composes it — imports collected, nested fills recursed, provenance commented. Which render site it lands in is the slotsToChildren rule under Props.
subcomponentboundan import of the sibling subcomponent’s emitted component#/subcomponents/<key> resolves to the emitted sibling and renders as an ordinary composed instance.
tokenboundnothing directly — styling is the CSS binding’sThe emitter never reads a $token; tokens reach React only through the stylesheet the CSS binding declares.
themeapproximateda static data-theme-<group> attribute on the element that selects the themeA selection on the default variant emits as an attribute matching the override block the CSS binding declares, and an InstanceExample selection emits as a story arg. Not realised: a selection a variant adds, changes, or withdraws with null. The attribute is written once from the default variant and does not vary with props, so a component whose variant shifts a theme renders every configuration under the default variant’s theme and a null withdrawal has no effect. Variant-dependent emission needs the element’s selection resolved per prop configuration at render time, which this release does not do. A root selection is emitted before the rest spread, so a consumer setting the attribute overrides it; an encapsulated element’s is not overridable, which is the intended shielding.
conditionalunsupported—As the CSS binding declares: the condition is discarded on the way to a stylesheet.
elementTypeunsupported—External type references are a consumer concern (ADR-012); the emitter types elements by ElementType string only.
mixedunsupported—As the CSS binding declares: nothing is emitted for the sentinel.
nestedunsupported—The emitter never reads $nested: deep configuration reaches emitted examples through the slot-content graph instead — each registry entry carries its own configurations, and composition recurses (DSPEC-05’s division of labour).

Platform surfaces

The platform-shaped questions this binding owes, none of which are CSS. propsToParameters, slotsToChildren and variantsToSelection graduated into concepts.props and concepts.propRules above; variant selection itself is the CSS binding’s propsToSelectors rule.

SurfaceDisposition
styleAttachmentunverified

Absent keys

Inherited. See Absent keys on the Overview.