Skip to content
Calm motion: animations on this site only fade, with no movement

Button ​

Button or anchor

Three variants, one job each: solid is the action, outline is the alternative beside it, and ghost is the tertiary thing that you otherwise make a link. Color means chosen. Every button is ink at rest and fills with the accent while pressed, so the main action stands out by being solid, not by color. Hover fades and leans. Focus leans with the accent ring. Pressing fills. color="accent" is for a button that shows something already chosen. For a choice that stays on, use Toggle, which carries aria-pressed and fills itself. Use danger for destructive actions. If you can undo the action, do it and offer Undo from a Toaster instead of asking first. Use text (default) for the rest. type defaults to button, so a button inside a form does not submit by accident. For a submit button, say type="submit".

href renders an <a> (or your router's link) with the same look. disabled on a link is enforced: no navigation, out of the tab order. loading shows a spinner, sets aria-busy and ignores clicks while keeping focus, so a keyboard user stays on the button they pressed. A disabled or loading button does not pass its click on to your @click. block fills the container. icon makes the padding square for an icon-only button. Give it an aria-label.

Basic
Sizes
States
LinkDisabled link

Usage ​

ts
import { BlessButton } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
variant"solid" | "outline" | "ghost""solid"
color"text" | "accent" | "danger""text"
size"md" | "sm" | "lg""md"
hrefstring—renders <a> when set
disabledboolean—
loadingboolean—
type"submit" | "button" | "reset""button"
blockboolean—full width of its container
iconboolean—icon-only: equal padding all round — pass an aria-label

Events

NamePayloadDescription
click[e: MouseEvent]

Slots

NameScopeDescription
prefix—
default—
suffix—

Released under the MIT License. Character names and artwork belong to their owners.