ui

Button

A button or a component that looks like a button. Built with Base UI and Tailwind CSS. Copy-paste ready.

Installation

Usage

You can use the render prop to make another component look like a button. Here's an example of a link that looks like a button.

Examples

Default

The standard filled button using the primary brand color. Use this as the primary call-to-action on any surface.

Outline

A bordered button with a transparent background. Use it for secondary actions that should be visible but not dominant.

Secondary

A lower-contrast filled button for supplementary actions that sit alongside a primary button.

Destructive

A red-tinted button that signals an irreversible or dangerous action such as deletion.

Destructive Outline

The destructive intent expressed as an outlined button — less visually heavy while still clearly communicating danger.

Ghost

A button with no border or background until hovered. Ideal for low-priority actions inside dense UIs like toolbars.

Styled as a plain text link but retains button semantics and keyboard behavior.

Extra-small Size

The xs size targets tight spaces such as table rows or inline callouts.

Small Size

The sm size is suitable for secondary action areas where space is limited.

Large Size

The lg size works well as a prominent hero or marketing CTA.

Extra-large Size

The xl size creates a bold, full-width call-to-action for landing pages or onboarding flows.

Disabled

Pass disabled to prevent interaction. The button remains visible but is styled at reduced opacity.

Icon

A square icon-only button. Always add aria-label when there is no visible text label.

With Trailing Icon

An icon placed after the label reinforces the action direction — commonly used for navigation or expand patterns.

With Leading Icon

A leading icon provides quick visual identification of the action before the user reads the label.

Outline With Icon

Combines the outline style with a leading icon, suitable for secondary actions that benefit from visual cues.

Ghost With Icon

A ghost button with a trailing icon — common for expand, link, or navigation affordances in compact UIs.

Destructive With Icon

A delete or remove action reinforced with a warning icon to ensure the user notices the destructive intent.

Combines the link style with a trailing arrow or external-link icon to indicate navigation away from the current page.

Star button with count

A GitHub-style star button that combines an icon, label, and a separated count badge using a vertical border divider.

With Unread Badge

An inbox or notification button with an absolute-positioned badge showing the unread count, positioned at the top-right corner.

With Shortcut

Pairs a label with Kbd shortcut hints so users can discover keyboard equivalents at a glance.

Copy With Feedback

Clicking the copy icon triggers a brief state change — the icon swaps to a check mark for 2 seconds to confirm the copy without a toast.

Hamburger Toggle

A menu toggle that morphs its three lines into an ✕ on press, providing smooth visual feedback for sidebar open/close state.

Sliding Icon Reveal

The icon is hidden off-screen and slides into view on hover using a CSS transform, creating an animated "reveal" effect on the button.

Social Login

A set of OAuth login buttons for GitHub and Google alongside an email option, separated by an "or continue with" divider row.

Loading and Success State

A single button that cycles through idle → loading → success states with an animated icon swap, useful for async form submissions.

File Upload

Clicking the button triggers a hidden file input; selected filenames appear as a pill with a clear button to reset the selection.

Split Button

A Group with a primary action button and a GroupSeparator followed by a chevron trigger that opens a Menu of additional options.

Segmented View Toggle

A Group of three icon buttons (List, Table, Kanban) that act as a view mode selector, highlighting the active choice with a filled style.