bit Bheadless

Button

A polymorphic, accessible button primitive with loading and disabled states.

Implementation: CSS Tailwind

Basic Button

Renders a native <button> with no styling. All visuals come from you.

Clicked 0 times

Disabled State

Sets the native disabled attribute and emits data-disabled for CSS hooks.

Loading State with Context

Uses RenderFragment<BitBhButtonContext> so you can conditionally render a spinner driven by the button's own state.

Polymorphic Rendering

Set As="a" to render as an anchor while retaining all button semantics. Non-native elements automatically receive role="button", tabindex="0", and Enter/Space keyboard handling.

I'm actually an <a> tag I'm a <span> with role="button"

Toggle Button

Combine BitBhButton with your own state to build a toggle. Pass aria-pressed via standard HTML attributes — they merge automatically.

Styled via Data Attributes

Style entirely via CSS attribute selectors. No component API for colors, sizes, or variants — that's your domain.

An unhandled error has occurred. Reload 🗙