Skip to content

BeeButton ​

A button with three variants, a rounded shape, a loading state and a disabled state.

ts
import { BeeButton } from "@thaisrr/beedesign";
import "@thaisrr/beedesign/style.css";

Variants ​

primary for the main action of a screen, secondary for alternative actions, ghost for discreet actions.

Rounded shape ​

By default, the corners are slightly rounded. The rounded prop turns the button into a pill (--bd-radius-full). It works with every variant.

States ​

While loading, the button keeps its width, shows a spinner and ignores clicks. It exposes aria-busy to screen readers.

API ​

Props ​

NameTypeDefaultDescription
variant"primary" | "secondary" | "ghost""primary"Visual style of the button.
type"button" | "submit" | "reset""button"type attribute of the native <button>.
roundedbooleanfalsePill-shaped button.
disabledbooleanfalseDisables the button.
loadingbooleanfalseShows a spinner and blocks clicks.

Events ​

NamePayloadDescription
clickMouseEventEmitted on click, unless the button is disabled or loading.

Slots ​

NameDescription
defaultLabel of the button.

CSS variables used ​

--bd-color-primary, --bd-color-primary-hover, --bd-color-primary-edge, --bd-color-on-primary, --bd-color-primary-dark, --bd-color-primary-light, --bd-color-border, --bd-color-text-muted, --bd-color-focus, --bd-font-main, --bd-font-size-md, --bd-radius-full, --bd-space-sm, --bd-space-md, --bd-control-height, --bd-border-width-strong, --bd-focus-ring-width, --bd-focus-ring-offset, --bd-button-edge, --bd-transition-fast.

Accessibility ​

  • Touch target at least 44 px tall.
  • Visible focus ring on keyboard navigation (:focus-visible).
  • aria-busy while loading.
  • Reduced animations when prefers-reduced-motion is enabled.