Skip to content

Toggle ​

Pressed buttons

A button that stays pressed — bold in a toolbar, a filter that's on. For a setting that applies at once, a Switch reads clearer; for a set of them, wrap toggles in a ToggleGroup.

Basic
Group Basic
align: left · fmt: [ "b", "i" ]
  • It is a <button aria-pressed>, so it's read as "Bold, toggle button, pressed".
  • An icon-only toggle needs label.
  • In a ToggleGroup, type="single" allows one at a time (click the pressed one again to clear) and type="multiple" any number; give the group a label.

Usage ​

ts
import { BlessToggle, BlessToggleGroup } from "blessing-ui";

API ​

BlessToggle ​

Props

NameTypeDefaultDescription
valuestring | number—required inside a BlessToggleGroup
size"md" | "sm" | "lg""md"
color"text" | "accent" | "danger""accent"
disabledboolean—
labelstring—
pressedbooleanfalse

Events

NamePayloadDescription
update:pressed[value: boolean]

Slots

NameScopeDescription
default—

BlessToggleGroup ​

Props

NameTypeDefaultDescription
type"single" | "multiple""single"
disabledboolean—
labelstring—
modelValueT | T[]—

Events

NamePayloadDescription
update:modelValue[value: T | T[] | undefined]

Slots

NameScopeDescription
default—

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