Skip to content

SlotProp

Slot property definition — the component’s composable region: a prop a consumer fills with content rather than a scalar. A request for a component to be “composable”, or for content “consumers supply”, describes one of these. What it accepts is declared in its own anyOf member, and how many children it admits in minChildren and maxChildren.

Path

component-api:props.<prop>

Members

MemberTypeRequiredDescription
type'slot'YesThe discriminator — always 'slot'.
defaultnull · stringNoDefault slot content.
nullablebooleanNoWhether this slot prop accepts a null value.
minChildrenintegerNoMinimum number of children this slot accepts
maxChildrenintegerNoMaximum number of children this slot accepts
anyOfComponentName[]NoWhat this slot permits — the one list of its accepted content.
defaultSlotbooleanNoWhether this is the component’s designated default slot — the one slot an instance may fill by plain nesting instead of an explicit reference.
$extensionsPropExtensionsNoPlatform provenance under reverse-domain keys.

Example

type: slot
defaultSlot: true
minChildren: 1
maxChildren: 1
anyOf: [$glyph, $text, badge]

Constraints

Slot constraint members (minChildren, maxChildren, anyOf) are emitted when conventions.platforms.figma.slotConstraints is declared.

Platform bindings

Figma

Disposition: bound · Realised by: ComponentPropertyDefinitions (SLOT), plus slotSettings and preferredValues

Native SLOT properties read as type: slot. Under platforms.figma.slotConstraints, slotSettings and resolved preferredValues populate minChildren/maxChildren/anyOf (ADR-056). A primitive marker joins anyOf when a variant’s default content held a top-level $text/$glyph primitive and the platform reads slot primitives (ADR-102) — only ever joining an anyOf that already names a component. defaultSlot resolves once at generation from specs.slots.default.match, is refused when the prop is bound to anything but a container or slot element, and marks at most one prop (ADR-099). Render skips slot props — slot structure is rebuilt from the elements, not minted as a property.

CSS

Disposition: unsupported · Realised by: —

A slot is a place content goes. Its formatting travels on the slot element’s contentStyles, keyed by primitive kind — that styling is part of the styles surface above, not a mapping of the prop.

React

Disposition: bound · Realised by: children, or a named prop of React.ReactNode

Rules: slotsToChildren

A slot prop never reaches the platform-neutral contract — its type is the one part of a contract that cannot be platform-neutral, so each target spells its own. React spells the designated default slot as children and every other slot as a named React.ReactNode prop.

Web Components

Disposition: bound · Realised by: a native <slot> projection point

Rules: slotsToProjection

A slot prop never reaches the platform-neutral contract and never becomes a reactive property — it surfaces as a <slot>, whether or not it also accepts a primitive fill (a $text/$glyph marker widens what the slot can take, never turns it into a scalar property).

Decisions

  • ADR-015 — Resolve AnyProp oneOf schema violation between TextProp and IconProp
  • ADR-019 — Allow null in StringProp.default
  • ADR-022 — Add nullable support to SlotProp
  • ADR-105 — Type–Schema Parity for Overlapping Prop Unions
  • ADR-125 — Instance-example orientation

Rules

RuleStatement
DSPEC-12null is meaningful only under a nullable prop

Source

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