Mirror the public API
Variant and boolean properties use the same concepts and defaults as code.
Figma-equivalent component anatomy, sizing, properties, slots, overrides, and design-to-code parity rules.
A designer can create a supported instance without detaching it.
Each design property maps to a public prop, slot, or documented composition.
Resize, localization, and exceptional-state behavior is decided before release.
One component set represents one public concept. Names encode hierarchy, not visual styling.
| Layer | Pattern | Example | Rule |
|---|---|---|---|
| Library asset | Component / Name | Component / Button | Matches the public export name. |
| Variant property | Sentence case | Variant = Primary | Maps to a finite prop union. |
| Boolean property | Show + noun | Show icon = True | Controls optional visibility, not layout hacks. |
| Text property | Content role | Label = Save | Exposes only content intended for instance editing. |
| Nested layer | Semantic role | Leading icon | Names responsibility rather than shape or position. |
Variant and boolean properties use the same concepts and defaults as code.
Icons, field messages, and surfaces remain replaceable nested assets where supported.
Consumers may edit content and approved swaps, but should not need to unlock layout layers.
Utility and provider exports are marked as code-only instead of receiving fictional canvas assets.
Each axis has an explicit contract: hug, fill, fixed, or content-controlled.
| Mode | Use when | Avoid when | Code equivalent |
|---|---|---|---|
| Hug | Content defines the useful dimension. | Peer alignment requires equal widths. | inline-flex, w-fit, intrinsic sizing |
| Fill | The parent owns available space. | The control should remain content-sized. | w-full, flex-1, min-w-0 |
| Fixed | The dimension is a tokenized target. | Localized text or user content is present. | size-* or explicit component token |
| Content-controlled | Media or a consumer slot owns proportion. | The component can define a safe default. | aspect-ratio, min/max constraints |
Editable surfaces are intentional and finite. They should produce supported code, not arbitrary new component states.
Use a variant only when appearance and behavior form a named, supported option.
Hover, focus, pressed, loading, invalid, and disabled are prototype or specimen states unless the API directly owns them.
A slot declares acceptable content, size, alignment, and fallback behavior.
Limit swaps to assets that satisfy the same semantic and dimensional contract.
| Change | Allowed | Condition |
|---|---|---|
| Text content | Yes | Within documented content limits and accessible naming rules. |
| Nested icon swap | Yes | Same icon size and semantic role. |
| Semantic color token | By variant only | No local fills or raw values. |
| Internal spacing | No | Request a supported size or composition instead. |
| Layer deletion | Boolean property only | Do not delete locked structural layers. |
| Detach instance | Exception only | Requires a documented system gap and follow-up issue. |
Parity means equivalent decisions, defaults, states, and behavior. Pixel similarity alone is insufficient.
Owner: Designer
Anatomy, variants, content bounds, resize rules
Owner: Engineer
Property-to-prop and slot-to-composition mapping
Owner: Design and QA
Theme, locale, zoom, keyboard, state evidence
Owner: Design Systems
Versioned design asset, package release, migration note