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.

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