Button
Six variants, three sizes, a loading state that keeps its width, and an icon button that insists on a label.
- Category
- Forms
- Access
- Free with an account
- Source
- 123 lines · one file
- Added
- 4 Oct 2026
The decision inside it
Loading keeps the width
A button that shrinks when its label turns into a spinner moves everything beside it. The label stays in the layout, invisible, and the spinner sits over it; `aria-busy` tells a screen reader what happened.
When to use it
Use Button for actions: primary, secondary, outline, ghost, destructive and link variants, with an icon, a loading state and asChild for links. IconButton is the square icon-only button and requires a label for screen readers.
Installation
How you get it
Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.
Use Liro's Button for this.
Install it: npx shadcn@latest add @liro/button
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/button.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Free components install through the @liro registry with your CLI token: see the Namespaced tab.
Usage
import { Trash2 } from "lucide-react";
import { Button, IconButton } from "@/components/ui/button";
export function Actions({ saving, save, remove }: { saving: boolean; save: () => void; remove: () => void }) {
return (
<div className="flex gap-2">
<Button onClick={save} loading={saving}>Save changes</Button>
<Button variant="outline" asChild>
<a href="/settings">Settings</a>
</Button>
<IconButton label="Delete" variant="ghost" onClick={remove}>
<Trash2 className="h-4 w-4" />
</IconButton>
</div>
);
}API reference
“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.
Props
Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.
| Type | Notes | ||
|---|---|---|---|
variant | ButtonVariant | No | How much attention the action deserves. Default `primary`. |
size | ControlSize | No | Matches Input and Select of the same size. Default `md`. |
icon | boolean | No | Square, for a single icon. Give it an `aria-label` — or use IconButton, which requires one. |
loading | boolean | No | Shows a spinner in place of the leading icon and marks the button busy. |
asChild | boolean | No | Render the child element (a link, say) with the button's styling instead of a `<button>`. |
shape | "rounded" | "pill" | No | `rounded` is the squircle that matches inputs; `pill` is fully round, for marketing pages and toolbars of pills. Default `rounded`. |
Dependencies
npm packages
@radix-ui/react-slotclsxlucide-reacttailwind-mergeLiro foundations, installed alongside it
liro-themeAccessibility
- Keyboard reachable throughout, in visual order
- Focus trapped in overlays, Escape closes them
- Focus returns to whatever opened it
- Live regions announce what changed, not that something did
- Honours prefers-reduced-motion
Responsive behavior
- Sizes to its container, not the viewport
- Usable from 320px up
- Pointer-based interaction, so trackpad and touch both work
- No hover-only affordances
Used in screensAll screens
CRM
A sales pipeline: saved views as tabs, an editable company table, a board and a record drawer.
Analytics
A revenue dashboard: four key figures, revenue over time, channels, top products and what moved.
Multi-agent Chat
A chat with the agent running a job, the agents it handed work to, and the brief, side by side.
Assistant Home
The start page of an AI assistant: a greeting, the prompt box, connected apps and suggestions from them.
Evals
Decide whether a prompt version ships: a pass or block gate, pass rates, model checks and cases.
Integrations
Connected tools with their health first: what is broken, what is fine, and a directory to add more.
Onboarding
The first run of an AI workspace: name it, connect tools, invite the team, hire a first agent.
Files
A shared drive: folders and files in a grid or a list, drag to upload, rename, move and delete.
Code Editor
An editor with an agent beside it: files, tabs and code, and a chat whose edits you accept one change at a time.
Settings & Billing
Workspace settings, members, API keys and billing in one page, with one save bar for every change.