Composition Variants
A run with spec.splitConcerns writes variants.yaml as its own file. CompositionVariantsDocument is that file’s type: it requires what the variants concern carries and permits nothing else — no title, no description, no anatomy.
A composition does not vary by prop configuration the way a component does — it has no props — so there is no default/variants layering here. elements and layout are the whole of its one, unvarying appearance.
Properties
| Property | Type | Required | Description |
|---|---|---|---|
metadata | Metadata | Yes | Must set metadata.concern to variants |
elements | Elements | Yes | Per-element content, styles, and children |
layout | Layout | Yes | The composition’s layout tree |
See Also
- Composition — the full
Compositionshape and how it splits across concerns - Composition API and Composition Examples — the other two files
- Component Variants — the equivalent
variants.yamlcontract for a component, which layers adefaultwith overrides this document has no use for