Button

Polymorphic, accessible button with four variants, five sizes, loading state, optional dropdown, and href support.

Forms & Inputs@sisyphos-ui/buttonView on npm

Preview

tsx

Installation

Install the individual package:

snippet.bashbash
pnpm add @sisyphos-ui/button @sisyphos-ui/core

Or use the umbrella package that bundles everything:

snippet.bashbash
pnpm add @sisyphos-ui/ui

Usage

Import the component styles and the component itself:

snippet.tsxtsx
import "@sisyphos-ui/button/styles.css";
import { Button } from "@sisyphos-ui/button";

Variants

Four visual treatments.

tsx

Semantic colors

Pick a color token to communicate intent.

tsx

Sizes

tsx

Loading state

`aria-busy` is set and click is suppressed while loading.

tsx

API

PropTypeDefaultDescription
variant"contained" | "outlined" | "text" | "soft""contained"Visual treatment.
color"primary" | "success" | "error" | "warning" | "info""primary"Semantic color token.
size"xs" | "sm" | "md" | "lg" | "xl""md"Button size.
loadingbooleanfalseShow a loading spinner; suppresses clicks.
startIconReactNodeIcon rendered before the label.
endIconReactNodeIcon rendered after the label.
hrefstringWhen set, renders the button as an anchor.
dropdownItemsButtonDropdownItem[]Inline split-button menu items.

The full API including refs, ARIA attributes, and HTML passthroughs lives in the package README.

Accessibility

  • aria-busy applied while loading; click suppressed.
  • aria-disabled mirrors disabled.
  • Dropdown uses aria-haspopup="menu" + aria-expanded; items expose role="menuitem".