Elements Pro launch: $79 for the first 50 with LAUNCH50 · $129 standard.

Components / Actions / Button

Button.

FreePrimitive

A Base UI-backed action control with semantic variants.

Demo dataResponsive

Installation

pnpm dlx shadcn@latest add https://elements.micropreneur.dev/r/button.json

The shadcn CLI writes the source into your project. Files added:

  • components/ui/button.tsxui
  • lib/utils.tslib
Dependencies@base-ui/reactclass-variance-authorityclsxtailwind-merge

API

PropTypeDefaultDescription
variant'default' | 'outline' | 'secondary' | 'ghost' | 'destructive' | 'link''default'
size'default' | 'sm' | 'lg' | 'icon''default'

Also accepts ButtonPrimitive.Props.

Accessibility

  • Renders a native button through Base UI, so Enter, Space and disabled states work without extra code.
  • Focus shows a ring plus a border change, not color alone.
  • Icon-only buttons need an aria-label from the caller.