variant
The variant command lets you:
- Define reusable variant templates for components (
tempo variant define) - Generate variant instances from those templates (
tempo variant new)
Define Variant Template
bash
tempo variant defineCreates a scaffold for defining a variant of an existing component (e.g., an outline button variant), including template files and an action JSON file.
These definitions are later used by tempo variant new to generate real component variants.
Flags
--force- Force overwriting if the variant definition already exists (default: false)
--dry-run- Preview actions without making changes (default: false)
Generate Variant Instance
bash
tempo variant new --name outline --component buttonUses the templates and actions created with tempo variant define to generate a real instance of a variant inside the corresponding component folder.
Example: Running tempo variant new --name outline --component button will generate:
components/button/variant/outline.templassets/button/css/variant/outline.css
Flags
--package(-p) value- The Go package name where components will be generated (default: components)
--assets(-a) value- The directory where asset files (e.g., CSS, JS) will be generated (default: assets)
--name(-n) value (required)- The name of the variant being generated
--component(-c) value (required)- Name of the component or entity to which this variant belongs
--force- Force overwriting if the variant already exists (default: false)
--dry-run- Preview actions without making changes (default: false)