import { Button } from "@/components/wensity/button";export function ButtonSecondary() {return <Button variant="secondary">Save draft</Button>;}
Button
A React button component on Base UI with seven variants, from the solid default to ghost and link, four sizes, icon slots, and a built in loading state.
Examples
Practical examples and common states for the same installable component.
Secondary
Quiet supporting action that still reads as clickable.
White
Bright CTA reserved for dark heroes or one-action moments.
Destructive
Danger action for deletion or irreversible changes.
Icons
Optional left and right icon slots without extra wrappers.
Loading
Built-in loading state disables the action and keeps width stable.
import { Button } from "@/components/wensity/button";export function ButtonLoading() {return <Button loading>Saving changes</Button>;}
Ghost
Toolbar and dense UI action with minimal chrome.
import { Button } from "@/components/wensity/button";export function ButtonGhost() {return <Button variant="ghost">Cancel</Button>;}
Disabled
Disabled buttons keep layout stable while clearly dropping emphasis.
Overview
Button is a React and Tailwind CSS button component built on Base UI, in Next.js or any React app, installed with the shadcn or Wensity CLI. Seven variants run from the solid default and secondary to outline, ghost, white, destructive, and link, in sm, md, lg, and icon sizes. Setting loading swaps the label for a spinner, sets aria-busy, and blocks clicks. The icon slots can play a short hover motion that only runs for a fine pointer and stops under reduced motion. To style a Next.js Link as a button, pass it as the child and set asChild.
Installation
Run the following command
pnpm dlx wensity@latest add button
npx wensity@latest add button
yarn dlx wensity@latest add button
bunx wensity@latest add button
Usage
Import Button from @/components/wensity/button and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.
import { Button } from "@/components/wensity/button";export function ButtonDemo() {return <Button>Button</Button>;}
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "secondary" | "outline" | "ghost" | "white" | "destructive" | "link" | "default" | Visual weight of the button. white is for dark heroes; link renders as inline text. |
size | "sm" | "md" | "lg" | "icon" | "md" | Control height and padding. icon renders a square button with no gap. |
loading | boolean | false | Swaps the content for a spinner and blocks interaction while an action is in flight. |
disabled | boolean | false | Disables the button and drops it to 45% opacity. |
focusableWhenDisabled | boolean | - | Keeps the button reachable by keyboard while disabled, so screen readers still announce it. |
leftIcon | React.ReactNode | - | Icon rendered before the label. Sized to 16px automatically. |
rightIcon | React.ReactNode | - | Icon rendered after the label. Sized to 16px automatically. |
leftIconMotion | "trash" | "mail" | - | Animates the left icon on hover with a named motion recipe. |
rightIconMotion | "arrow" | "download" | - | Animates the right icon on hover with a named motion recipe. |
asChild | boolean | false | Renders the child element instead of a button, keeping styles. Use for links. |
Related primitives
Button Group
A React button group for toolbars and segmented controls, with shared borders, vertical layout, and split buttons that open a dropdown menu.
Toggle
A React toggle button and toggle group on Base UI in default, icon, outline, and soft styles, with a sliding segmented mode or multi select for toolbars.
Dropdown Menu
A React dropdown menu on Base UI with grouped sections, submenus, checkbox and radio items, shortcut hints, and destructive actions for rows.
Spinner
A React loading spinner in arc, ring, dots, and pulse styles with a screen reader label, five tones, three sizes, and an overlay that blocks a region.
Related components

Liquid Metal Button
A pill or icon button ringed in flowing liquid metal, for light and dark pages.

Liquid Glass Button
Frosted glass that bends the page at its edge, with a rim that catches the light.

Cool Button
A dual-layer orbit glow that soft-spins around the edge of any button or link you wrap it around, at zero layout cost.

Physics-Based Confetti Cannon
Hand-rolled canvas particles with gravity, drag, terminal velocity, and paper ribbons that flutter on the way down.