Button Examples
35 button compositions: loading spinners, leading and trailing icons, count badges, keyboard hints and pill shapes, across standard, secondary, outline, link and destructive variants. Each on React, Vue, Svelte and Solid, with Base UI, React Aria, Ark UI or Radix UI on React.
Every button example
35 examples.
- Button with CountDestructiveA destructive button with a count of what will be removed, when one delete covers more than a single selected item.

- Button with CountLinkA link-styled button with a count beside the label, when a quiet action should show how many items it actually covers.

- Button with CountOutlineAn outline button with a count beside the label, when a secondary action should show how many items it actually covers.

- Button with CountSecondaryA muted button with a count beside the label, when a supporting action should show how many items it actually covers.

- Button with CountStandardA filled button with a count beside the label, when the main action applies to more than one selected item at once.

- Button with KbdDestructiveA destructive button with a keyboard hint beside the label, when a dangerous action has a shortcut you still want visible.

- Button with KbdLinkA link-styled button with a keyboard hint beside the label, when a quiet action has a keyboard shortcut worth showing.

- Button with KbdOutlineAn outline button with a keyboard hint beside the label, when a secondary action has a keyboard shortcut worth showing.

- Button with KbdSecondaryA muted button with a keyboard hint beside the label, when a supporting action has a keyboard shortcut worth showing.

- Button with KbdStandardA filled button with a keyboard hint beside the label, when the main action has a shortcut people can actually use.

- Button with Left IconDestructiveA destructive button with an icon before the label, when a delete should be obvious before anyone reads the word itself.

- Button with Left IconLinkA link-styled button with an icon before the label, when a quiet action is easier to scan with a symbol beside the words.

Or describe it. With Pro, your AI agent installs the button example you describe, on your framework and UI library.
Get ProGalleries
More component examples
8 related galleries, free: open one for its live examples and their code.
Pricing
Button examples MCP, with Pro
Your AI agent installs any of the 1364 examples, and every component, block and icon, with every Pro plan.
4.9/5 out of 5 · 150+ reviewsfrom 150+ founders and developers.
- Secure checkout via Stripe
- Code lives in your repo
- Keep what you've shipped if you cancel
- License terms
FAQ
Frequently asked questions
The control for actions: submit a form, open a dialog, save, delete. shadcn.io's Button renders a real button with variants, sizes, a pill shape and a loading state, built on Base UI, React Aria, Ark UI and Radix UI for React, and on Ark UI for Vue, Svelte and Solid. Each example in this gallery is one small file showing one composition.
Yes. Every button example is free to use in personal and commercial projects, with no attribution required. Seeing the code and installing an example takes a free shadcn.io account.
It is a button element underneath, so focus, Enter and Space, and form submission work as usual. Button adds the design: variants, a size scale, focus rings, disabled styles, icon spacing with `data-icon`, a `pill` shape and a built-in loading state. Its `type` defaults to `button`, so it never submits a form by accident.
Use a Button for actions that stay on the page, even when it uses the link variant. Use a real link when the click opens another URL; Button can render as a link while keeping its styles, and the Button page shows how for each library.
The default, filled variant, for the one action you want people to take: Save, Continue, Sign up. Keep one per section, and give the other actions secondary, outline or link so they don't compete.
For actions that remove something or can't be undone: Delete, Remove member, Cancel subscription. Confirm the irreversible ones in an Alert Dialog. Cancel in a dialog keeps things as they are, so it isn't destructive.
Disable the button while the request runs and put a Spinner before the label, marked `data-icon` `inline-start`, as the Loading examples do. Or use the built-in loading state, which hides the label, centers a spinner and keeps the button's width.
Secondary has a muted fill, for the second action in a row. Outline has a border on the page background, for Cancel or Back. Link is the label alone in the primary color, underlined on hover, for quiet actions in text, tables and card footers.
Sign in with a free account, then copy the code or run the install command on the example's page. It adds the example and the components it uses, Button and, where needed, Badge, Kbd or Spinner, to your project.
Render it as a link so it keeps the button's styles and gets real link behavior, such as opening in a new tab. Each library does this its own way; the Button page shows it for every library and framework.
Edit the Button component in your project and add an entry to its variants or sizes. Color new variants from theme tokens, such as `bg-success text-success-foreground`, so they follow light and dark mode.
Put a Kbd after the label, as the With Kbd examples do. Kbd only draws the keys; listen for the shortcut yourself and run the same handler as the click.
The Button component and Tailwind CSS, plus Badge, Kbd, Spinner and Lucide icons where an example uses them. The examples have no state of their own.
Each renders a real button, focusable and activated by Enter and Space, with a visible focus ring. Icons inside a labeled button have `aria-hidden`, and an icon-only button needs an `aria-label`. A disabled button can't be focused or pressed.
On React, these examples have no state or handlers, so they render from a Server Component. A button that handles a click in your app needs a client component around that handler.
Tailwind CSS v4, the version shadcn.io's components are written for. The examples use its class names and theme tokens, such as `bg-primary-foreground/20`.
4.9 out of 5 from 150+ developers
Every button example. One prompt away.
Every button example is free with an account. With Pro, your AI agent installs them from a prompt.
Get Pro






















