Stable accessible command name.
Primitive contract
Button
Triggers an action without implying navigation and preserves the v0.0.2 tone, size, class, and visible-state contract.
Command trigger · @sanchika/primitivesPurpose and semantics
Triggers an action without implying navigation and preserves the v0.0.2 tone, size, class, and visible-state contract.
Recommended semantic: Prefer native button with an explicit type. Non-button role=button implementations remain a consumer exception with full APG obligations.
Anatomy
Supporting icon that does not replace the label.
Visual pending indicator that does not change intrinsic button size.
Finite variants and important states
- Variant · tone
- brand, neutral, danger
- Variant · size
- sm, md, lg
- Required states
- default, hover, focus-visible, pressed, disabled, loading
- Class hooks
.sk-button · .sk-tone-brand · .sk-tone-neutral · .sk-tone-danger · .sk-size-sm · .sk-size-md · .sk-size-lg
Composed synthetic exemplar
Rendered state matrix
Button: 6 required states
Each specimen starts from the package-owned example and contract state inventory. Simulated pointer and focus frames are labelled; consumers still verify real interaction in context.
Accessibility and consumer responsibility
- Native button activation
- Space and Enter for role=button exceptions
- Suppress all activation paths when aria-disabled
- Keep focus predictable after activation
- Provide an accessible name
- Expose aria-pressed for toggles
- Expose aria-busy for loading
- Associate disabled reason when needed
- Implement runtime action and loading logic
- Manage focus after workflows
- Suppress activation for aria-disabled
- Provide visible disabled reasons
- Labels wrap
- The control stays within available width
- Primary mobile actions should use the large size or consumer-owned full-width composition
Transitions are removed while the static loading indicator and visible pending text/state remain.
- Focus uses system Highlight
- Control boundary uses ButtonText
- Disabled and pressed state remain visible without authored color
Compact API reference
- Package
@sanchika/primitives- CSS
@sanchika/primitives/styles.css- Contract
primitiveSpecs.find((contract) => contract.name === "Button")- Primary class
.sk-button