Skip to content

defaultSlotContent

A run choice in config/settings.yaml. When true, the generator emits Component.slotContentExamples — the default content placed inside a component’s slot layers, captured structurally and referenced from each slot binding via $slotContent. Defaults to false, so output for unannotated components is unchanged until you opt in.

Unlike instanceExamples, slot content examples need no detection convention — they are derived structurally from whatever content sits inside slot layers. This flag is the only control, and because it is a run choice rather than a library fact, it lives in settings.yaml.

Configuration

spec:
defaultSlotContent: true # emit structurally-detected default slot fills

Result

Each slot binding gains a $slotContent example pointer, and the referenced fill is emitted into slotContentExamples. From the DS Alert output, the children slot points at its captured default content:

{
"default": {
"elements": {
"children": {
"children": {
"$binding": "#/props/children",
"examples": [
{ "$slotContent": "#/components/dsAlert/slotContentExamples/dsAlert__children__default" }
]
}
}
}
}
}

That reference resolves to a structurally-captured fill — here a title, description, and an actions instance (trimmed):

{
"slotContentExamples": {
"dsAlert__children__default": {
"anatomy": {
"text": { "type": "container" },
"title": { "type": "text" },
"description": { "type": "text" },
"actions": { "type": "instance", "instanceOf": "dsAlertActions" }
},
"elements": {
"title": { "content": "{Title}" },
"description": { "content": "{Description}" }
},
"layout": [
{ "text": ["title", "description"] },
"actions"
]
}
}
}

With defaultSlotContent: false (the default), the slot binding carries no $slotContent example and the slotContentExamples registry is omitted.

Not the same thing as slots.default

Two names sit uncomfortably close together, and they answer different questions:

What it isWhere it livesWhat it decides
defaultSlotContenta run choiceconfig/settings.yamlwhether composed slot content is recorded at all
slots.defaulta library factconfig/conventions/figma.yamlwhich slot is the designated default, and therefore what shape its fill takes

“Default” means a different thing in each. Here it means the content a slot defaults to — whatever a designer placed inside the slot layer. There it means the designated slot, the one a layout component always composes through.

They compose rather than overlap. This flag governs a component’s own slot layers, which is the case slots.default does not touch: the component declares that slot, so content in it is the slot’s authored default and stays a slotContentExamples entry pointed at from the binding, exactly as shown above — whether or not the prop is also marked defaultSlot: true.

Where they meet is a nested instance. When this flag is on and the library declares slots.default, a fill into a nested instance’s default slot is captured as that instance’s children instead of as an entry. So turning this flag on is what opens the door; the convention decides which slots walk through it. A composition is exempt from this flag — composed content is the whole reason a composition exists — so its nesting follows the convention alone.

Properties

PropertyTypeDefaultDescription
defaultSlotContentbooleanfalseEmit the component’s default slot content into Component.slotContentExamples — fills detected structurally from content inside slot layers

Path

spec.defaultSlotContent in config/settings.yaml

Licensing

defaultSlotContent output requires a Pro license. On the free tier the flag is silently ignored — slot content is neither stamped nor emitted, regardless of config. This applies to the CLI, the REST API, and the Figma plugin (where the control is hidden until a Pro license is active).

See Also