Components/Button

Button

A flexible, accessible button component with multiple variants, sizes, loading states, and icon support. Powered by spring animations via Motion v12.

import { Button } from "@animui/ui"

Variants

Six built-in variants cover the most common use cases.

Sizes

Use size to adjust padding and font size.

Loading state

Pass loading to show a spinner and prevent double-submission.

Props

PropTypeDefaultDescription
variant"default" | "outline" | "ghost" | "danger" | "gradient" | "glow""default"Controls the visual style of the button.
size"xs" | "sm" | "md" | "lg" | "xl" | "icon""md"Controls padding and font size.
disabledbooleanfalseDisables interaction and applies reduced opacity.
loadingbooleanfalseShows a spinner and disables the button while an async operation is in progress.
classNamestringAdditional Tailwind classes to apply to the button element.
onClick() => voidClick handler for the button.
type"button" | "submit" | "reset""button"HTML button type attribute.

Accessibility

  • Renders a native <button> element — keyboard focusable by default.
  • Focus ring meets WCAG 2.4.11 minimum contrast requirements.
  • Loading state sets aria-busy="true" and aria-disabled="true".
  • Icon-only buttons: pass aria-label for screen reader context.
© 2026 Steal Shadow. MIT License.Report an issue