Skip to content

Subcomponents

Subcomponent discovery configuration. When present, enables subcomponent detection. When absent, subcomponents are not detected.

Configuration

config:
processing:
subcomponents:
scope: PAGE
match:
- '{C} / {S}'
- '{C} / _ / {S}'
exclude:
- '{C} / Examples / {S}'

Result

Matched assets are harvested into a subcomponents registry on the component. Below is a narrow slice of the DS Alert output: the DS Alert / Actions subcomponent, discovered via a {C} / {S} pattern.

{
"title": "DS Alert",
"subcomponents": {
"actions": {
"title": "DS Alert / Actions",
"anatomy": {
"root": { "type": "container" },
"children": { "type": "slot" }
},
"props": {
"children": { "type": "slot" }
}
}
}
}

Without subcomponents, the registry is absent and these nested components are not detected.

Properties

PropertyTypeRequiredDefaultDescription
scope"NESTED" | "PAGE"NoNESTEDWhere to search. NESTED = component anatomy only; PAGE = also search the Figma page
matchstring[]YesTemplate patterns using {C} (component name) and {S} (subcomponent name) placeholders
excludestring[]NoTemplate patterns to exclude from matches. Same {C}/{S} syntax

An asset must match at least one match pattern to be considered a subcomponent. If it also matches an exclude pattern, the exclusion wins regardless of discovery source.

Path

config.processing.subcomponents

See Also