Appica UIUI 1.0.0

Button

A clickable button for actions, in a range of styles and sizes.

Usage

Examples

Variants

The variant prop sets the visual style. light is meant for dark or image backgrounds and is omitted below.

Sizes

With an icon

Mark an icon with data-icon="start" or data-icon="end" so the button reserves the right inner spacing. Use an icon-* size for an icon-only button, and always give it an aria-label.

Loading state

While an action is in flight, set disabled to block further clicks and swap the label to a Spinner. Add focusableWhenDisabled so focus stays on the button when it becomes disabled — without it, focus would jump to the body. Give the Spinner currentColor so it inherits the button's text color, and data-icon="start" so it gets the same inner spacing as an icon.

A link should stay a link. To make an <a> (or your router's <Link>) merely look like a button, apply the exported buttonVariants classes to it directly — don't render it through Button. See Composition → Links that look like a button.

RTL

Every Appica UI component supports right-to-left layouts out of the box. Set the dir attribute on a container (commonly your <html> element) so CSS logical properties resolve correctly, and wrap your tree in DirectionProvider so direction-aware behavior — roving focus, popup placement, and the like — follows the same direction.

For setup details and caveats, see the RTL guide.

API reference

Button wraps Base UI's Button and passes every remaining prop (onClick, type, aria-*, ref, …) straight through, so anything the Base UI primitive accepts works here — see its docs for the full API. Inside a ButtonGroup, variant and size are inherited from the group unless set on the button.

Accessibility

  • Renders a native <button> (or whatever you pass to render), so it is focusable and in the tab order by default.
  • Enter and Space activate the button.
  • disabled removes the button from the tab order and sets data-disabled for styling; the pointer is disabled via pointer-events-none.
  • Icon-only buttons have no text, so give them an aria-label.
  • All press and hover transitions are wrapped in motion-reduce: variants, so they are skipped when the user prefers reduced motion.

© 2026 Appica UI. A free component library, crafted by the Appica team.