Skip to Content
Actions & Basics@hacline/ui/toggle

Toggle

Control a single toggle button or a group of pressed-state buttons.

Usage

Click the formatting buttons to inspect multiple simultaneous pressed states. Organize related items in ToggleGroup with a descriptive accessible name on the root.

Controlled Single Toggle

Sync bookmark state back to your application via pressed and onPressedChange.

Not bookmarked

Parts

PartDescription
ToggleGroup
Toggles that share one value, with one tab stop and arrow keys between them. T is inferred from value, defaultValue or onValueChange.
ToggleIcon
An icon inside a toggle. A toggle with only an icon needs an aria-label. Screen readers skip it, and mirror flips it in right-to-left text.

Props

Prop

Type

View UI SDK parts and state attributes.