Behive Tech Registry

Button

v0.4.0

A flexible button component with variants, sizes, loading and disabled states.

pnpm add @behivetech/atoms.button

A flexible button component with variants, sizes, loading and disabled states.

Variants

Sizes

States

Icon-only

For buttons whose content is a single icon (glyph, <svg>, etc.) with no visible label, pass iconOnly and provide an aria-label for accessibility.

Props

PropTypeDefaultDescription
variantprimary | secondary | ghost | dangerprimaryVisual style
sizesm | md | lgmdButton size
loadingbooleanfalseShows spinner, disables interaction
iconOnlybooleanfalseSquare, padding-free layout for icon-only content — pair with aria-label
disabledbooleanfalseDisables the button
childrenReactNode—Button label
classNamestring—Additional class names

Compositions

Open all 9 →

Properties

Button props

PropTypeDefaultDescription
asChildbooleanfalseRenders the button's props onto its single child element (via Radix `Slot`) instead of a `<button>`
childrenReactNode—Button label/content
classNamestring—Additional class names to merge with the component root element
iconOnlybooleanfalseRenders the button as a square icon-only control with no visible label spacing
loadingbooleanfalseShows a spinner and disables the button while an action is in flight
size"sm" | "md" | "lg"mdControls the size; defaults to md
variant"primary" | "secondary" | "ghost" | "danger"primaryControls the color/style treatment; defaults to primary

Also accepts the native attributes of its root element (className, aria-*, event handlers, …).