⚡ ComponentForge

Button

Actions

Triggers actions with four visual variants, three sizes and a built-in loading state that preserves layout and announces itself to screen readers.

import { Button } from "@componentforge/react";

Examples

Playground

Flip the props — the rendered component and generated code update live.

Props

Accessibility

  • Renders a native <button> (type="button" by default) so Space/Enter activation and form semantics come for free.
  • Loading state sets aria-busy="true" and disables the control; a spinner is decorative (aria-hidden).
  • Focus ring is drawn only on :focus-visible so pointer clicks don't show it.

Keyboard interactions

KeyAction
Enter / SpaceActivate the button.
TabMove focus to the next focusable element.

API reference

Selected props — every component also spreads native HTML attributes.

PropTypeDefaultDescription
variant"primary" | "secondary" | "ghost" | "danger""primary"Visual emphasis.
size"sm" | "md" | "lg""md"Control height and padding.
loadingbooleanfalseShows spinner, disables interaction, sets aria-busy.
fullWidthbooleanfalseStretch to container width.