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.
| Rule | Surface | Keys |
|---|---|---|
| layoutWalk | Anatomy | container, text, glyph, instance, slot |
| semanticsAndTags | Anatomy | text, container, instance |
| slotsToChildren | Props | slot |
| statesToContract | Props | boolean, 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 kind | Disposition | Realised by |
|---|---|---|
boolean | bound | a boolean member of the component’s Props interface · rule statesToContract |
enum | bound | a named union type, one member per enum value · rule statesToContract |
image | bound | a nullable string URL member of the Props interface |
number | bound | a number member of the Props interface |
object | bound | a named member interface; values as object literals |
slot | bound | children, or a named prop of React.ReactNode · rule slotsToChildren |
string | bound | a 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 type | Disposition | Realised by |
|---|---|---|
container | bound | a div — or the tag its role decides · rule semanticsAndTags |
instance | bound | the composed component, imported and configured · rule semanticsAndTags |
rectangle | bound | a styled div |
slot | bound | the fill render site — children for the default slot, the named prop otherwise |
text | bound | a span carrying the element’s content · rule semanticsAndTags |
ellipse | approximated | a fully-rounded div |
glyph | approximated | an aria-hidden span painted by CSS mask |
line | approximated | a styled div |
vector | approximated | a styled div occupying the vector’s box |
polygon | unsupported | a styled div — box only, no shape |
star | unsupported | a 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 form | Disposition | Realised by | Notes |
|---|---|---|---|
binding | bound | prop access on the component — p.<key>, member pointers through member access | A $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). |
image | bound | a served asset URL | An $image pointer resolves to the registry entry’s served URL at emit — in props, configurations, and composed content alike. |
literal | bound | through the CSS binding’s stylesheet | Style values are the CSS binding’s; the emitter never reads them. |
slotContent | bound | recursive JSX composition from the registries | A $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. |
subcomponent | bound | an import of the sibling subcomponent’s emitted component | #/subcomponents/<key> resolves to the emitted sibling and renders as an ordinary composed instance. |
token | bound | nothing directly — styling is the CSS binding’s | The emitter never reads a $token; tokens reach React only through the stylesheet the CSS binding declares. |
theme | approximated | a static data-theme-<group> attribute on the element that selects the theme | A 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. |
conditional | unsupported | — | As the CSS binding declares: the condition is discarded on the way to a stylesheet. |
elementType | unsupported | — | External type references are a consumer concern (ADR-012); the emitter types elements by ElementType string only. |
mixed | unsupported | — | As the CSS binding declares: nothing is emitted for the sentinel. |
nested | unsupported | — | 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.
| Surface | Disposition |
|---|---|
styleAttachment | unverified |
Absent keys
Inherited. See Absent keys on the Overview.