structyl

Button

stable

A clickable control with six variants and four sizes, complete with spring-press feedback.

Basic usage

Examples

Sizes

Four sizes — sm, default, lg, and icon — plus a disabled state.

Variants and sizes

Preview the common visual variants, icon affordance and disabled state together.

Color palette

Use the color prop with contained, outlined, and text variants for semantic intent.

Features

  • Six visual variants and four sizes.
  • Spring-eased press animation on tap.
  • Supports `asChild` to render any element.
  • Full keyboard and screen-reader support.

Installation

bash
pnpm dlx structyl add button

API Reference

Button API reference

Full props, types, defaults, and all 3 parts.

View API

Keyboard interactions

KeyDescription
SpaceActivates the button.
EnterActivates the button.
Button | structyl