Skip to content

Button ​

Button or anchor

Three variants, one job each: solid is the action, outline the alternative beside it, ghost the tertiary thing you'd otherwise make a link. Colour 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 colour. 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; danger for destructive — and if the action can be undone, do it and offer Undo from a Toaster rather than asking first; text (default) for the rest. type defaults to button, so a button inside a form doesn't submit by accident — say type="submit" when it should.

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 doesn't 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"button" | "submit" | "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.