defaultSlot
Whether this is the component’s designated default slot — the one slot an instance may fill by plain nesting instead of an explicit reference. Absent means false. At most one slot prop per component may be true.
Path
component-api:props.<SlotProp prop>.defaultSlot
Value
boolean
The default slot
defaultSlot marks the one slot a layout component always composes through. It is set at generation time, when the prop’s name matched the library’s specs.slots.default.match convention, and is read off the spec thereafter — a consumer needs no access to those conventions to know which slot it is.
An instance filling a defaultSlot prop may be nested as a plain child rather than through a SlotContentRef. Every other slot binds explicitly, which is the only shape that can say which of several slots a fill belongs to.
At most one SlotProp per component may be true. This is a constraint over sibling entries in one props map, which JSON Schema cannot express without reaching into a named prop’s value to compare it against its siblings. It is therefore an authoring and generator contract, not schema-validated: specs generate marks at most one and reports a component whose declared convention matches several, and a hand-authored spec that breaks the invariant is malformed input a consumer may reject.
Decisions
- ADR-099 —
slots.default.match— Naming the Default Slot, and Flattened Instance Nesting
Source
| Format | File |
|---|---|
| JSON Schema | packages/schema/schema/component.schema.json |
| TypeScript | packages/schema/types/Props.ts |
| Specification | §4.2, §11 |