Component Variants
A run with spec.splitConcerns writes variants.yaml as its own file. ComponentVariantsDocument is that file’s type: it requires what the variants concern carries and permits nothing else — no anatomy, no props.
Properties
| Property | Type | Required | Description |
|---|---|---|---|
metadata | Metadata | Yes | Must set metadata.concern to variants |
default | Variant | Yes | Default variant — the baseline appearance |
variants | Variant[] | No | Layered variant overrides |
subcomponents | ComponentVariantsSubcomponent map | No | Embedded child component definitions, sliced to this concern — see Component |
See Also
- Component — the full
Componentshape and how it splits across concerns - Variants — the
Variantlayering model this file’sdefaultandvariantsuse - Component API and Component Examples — the other two files
- Composition Variants — the equivalent
variants.yamlcontract for a composition, which has no layering to hold