bit Bheadless

Toggle / Toggle Group

Two-state buttons styled with aria-pressed: and data-[state=on]: utilities.

Implementation: CSS Tailwind

Toggle button

BitBhToggle is a native button with aria-pressed and data-state="on|off". Space / Enter or a click flips it; use @bind-Pressed, DefaultPressed and Disabled.

Muted: no

State-aware content with Template

Template receives the bool pressed state. Keep the label constant and swap only the icon — aria-pressed conveys the state.

Multiple: text formatting

Type="BitBhToggleGroupType.Multiple" is a role="group" of aria-pressed buttons bound with @bind-Values. One tab stop; ← / → move focus, Home / End jump, Space / Enter toggle.

The quick brown fox jumps over the lazy dog.

Values: bold

Single: alignment

The default Single type is a radiogroup of radio items (aria-checked); the pressed item is the tab stop. AllowEmpty="false" stops a click on the pressed item from clearing the value.

Headless components ship behavior and accessibility, and leave every pixel of the presentation to you — so this paragraph can be aligned however you like.

Vertical orientation

Orientation="BitBhRovingOrientation.Vertical" switches navigation to ↑ / ↓ and sets data-orientation="vertical". Uncontrolled via DefaultValue; each item's Template draws a check mark.

Disabled items

A disabled item gets the native disabled attribute (style with disabled: or data-disabled:) and arrow keys skip it. Disabled on the group disables every item.

An unhandled error has occurred. Reload 🗙