Button
Polymorphic, accessible button with four variants, five sizes, loading state, optional dropdown, and href support.
Preview
Switch the framework picker (top-right of the panel) to render the same demo live in React, Vue, or Angular — same class names, ARIA, and visual output across all three.
Playground
Flip props to see how the component responds. The snippet below updates as you change options.
Installation
Sisyphos UI ships unified packages for React, Vue, and Angular. Pick the one that matches your stack — every framework exports the same component classes, ARIA semantics, and CSS tokens.
$ pnpm add @sisyphos-ui/reactThen import the bundled stylesheet once at app entry: import "@sisyphos-ui/react/styles.css";
Usage
import { Button } from "@sisyphos-ui/react";
export function Save() {
return (
<Button variant="contained" color="primary" onClick={() => console.log("save")}>
Save changes
</Button>
);
}Variants
Four visual treatments.
Semantic colors
Pick a color token to communicate intent.
Sizes
With icons
`startIcon` and `endIcon` accept any ReactNode — drop in a lucide icon or inline SVG.
Loading state
`aria-busy` is set and click is suppressed while loading.
Real world — sign-in form
Primary submit with a text-variant secondary action.
Real world — pricing CTA
Full-width primary CTA with an inline compare link.
Up to 10 seats, unlimited projects.
Real world — editor toolbar
Dense text buttons grouped around a primary publish action.
API
| Prop | Type | Default | Description |
|---|---|---|---|
| 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. |
| loading | boolean | false | Show a loading spinner; suppresses clicks. |
| startIcon | ReactNode | — | Icon rendered before the label. |
| endIcon | ReactNode | — | Icon rendered after the label. |
| href | string | — | When set, renders the button as an anchor. |
| dropdownItems | ButtonDropdownItem[] | — | Inline split-button menu items. |
The full API including refs, ARIA attributes, and HTML passthroughs lives in the package README on npm.
Accessibility
Adheres to the Button WAI-ARIA design pattern.
aria-busyapplied while loading; click suppressed.aria-disabledmirrorsdisabled.- Dropdown uses
aria-haspopup="menu"+aria-expanded; items exposerole="menuitem".
Keyboard interactions
| Key | Action |
|---|---|
| Enter | Activates the button. |
| Space | Activates the button. |
| Tab | Moves focus to the next focusable element. |
| ArrowDown | On a split button, opens the dropdown menu. |