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 Tailwind utility classes.

Clicked 0 times

Disabled State

Sets the native disabled attribute and emits data-disabled. The data-disabled: variant styles the disabled look.

Loading State with Context

Uses RenderFragment<BitBhButtonContext> to drive a spinner from the button's own state.

Polymorphic Rendering

Set As="a" to render as an anchor while keeping all button semantics. Non-native elements receive role="button", tabindex="0", and Enter/Space 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 the registered data-disabled: and data-loading: variants โ€” no component API for visuals.

An unhandled error has occurred. Reload ๐Ÿ—™