HomeDocsComponentsBlocksChartsThemes
Introduction
  • Introduction
  • Installation
  • Themes
  • llms.txt
Components
  • Accordion
  • Alert
  • Alert Dialog
  • Amount
  • Aspect Ratio
  • Audio Player
  • Avatar
  • Avatar Upload
  • Badge
  • Banner
  • Breadcrumb
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Code Block
  • Collapsible
  • Color Picker
  • Combobox
  • Command
  • Context Menu
  • Copy Button
  • Countdown
  • Data Grid
  • Data Table
  • Date Picker
  • Date Range Picker
  • Description List
  • Device Mockup
  • Dialog
  • Direction
  • Dot Loader
  • Drawer
  • Dropdown Menu
  • Empty
  • Field
  • File Upload
  • Hover Card
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kanban
  • Kbd
  • Label
  • Menubar
  • Meter
  • Multi Select
  • Native Select
  • Navigation Menu
  • Number Field
  • Pagination
  • Password Strength
  • Phone Input
  • Popover
  • Progress
  • Progress Circle
  • Radio Group
  • Rating
  • Resizable
  • Responsive Dialog
  • Rich Text Editor
  • Scroll Area
  • Segmented Control
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Sortable
  • Spinner
  • Stat
  • Stepper
  • Switch
  • Table
  • Tabs
  • Tag Input
  • Terminal
  • Textarea
  • Time Field
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Tree
  • Typography
  • Video Player
  • Window Mockup
AI
  • Message Scroller
  • Message
  • Bubble
  • Marker
  • Attachment
  • Questionnaire
  • Composer
  • Reasoning
  • Tool Call
  • Approval Card
  • Citations
Blocks
  • Airtable
  • Airtable Kanban
  • ClickUp List
  • ClickUp Kanban
  • Repeatable Group
  • Command Palette
  • Sign In and Sign Up
  • Availability Scheduler
  • AI Chat
  • Action Bar
  • Notion
  • Banking
  • Lineup Builder
  • Sports Score
  • Strava
  • Sheets
  • Notices
  • Settings
  • Billing
Utilities
  • motion
  • sounds
  • scroll-fade
  • shimmer
Another UI. Built on shadcn/ui with Phosphor icons.

Button

PreviousNext

Displays a button or a component that looks like a button.

Base UIReact AriaRadix UI
import { ArrowUpIcon } from "@phosphor-icons/react"

import { Button } from "@/components/ui/button"

Installation#

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

Usage#

import { Button } from "@/components/ui/button"
<Button variant="outline">Button</Button>

Cursor#

Tailwind v4 switched from cursor: pointer to cursor: default for the button component.

If you want to keep the cursor: pointer behavior, add the following code to your CSS file:

You can also enable this during project setup with npx shadcn@latest init --pointer.

globals.css
@layer base {
  button:not(:disabled),
  [role="button"]:not(:disabled) {
    cursor: pointer;
  }
}

Size#

Use the size prop to change the size of the button.

import { ArrowUpRightIcon } from "@phosphor-icons/react"

import { Button } from "@/components/ui/button"

Default#

import { Button } from "@/components/ui/button"

export function ButtonDefault() {

Outline#

import { Button } from "@/components/ui/button"

export function ButtonOutline() {

Secondary#

import { Button } from "@/components/ui/button"

export function ButtonSecondary() {

Ghost#

import { Button } from "@/components/ui/button"

export function ButtonGhost() {

Destructive#

import { Button } from "@/components/ui/button"

export function ButtonDestructive() {

Link#

import { Button } from "@/components/ui/button"

export function ButtonLink() {

Icon#

import { ArrowCircleUpIcon } from "@phosphor-icons/react"

import { Button } from "@/components/ui/button"

With Icon#

Remember to add the data-icon="inline-start" or data-icon="inline-end" attribute to the icon for the correct spacing.

import { GitBranchIcon, GitForkIcon } from "@phosphor-icons/react"

import { Button } from "@/components/ui/button"

Rounded#

Use the rounded-full class to make the button rounded.

import { ArrowUpIcon } from "@phosphor-icons/react"

import { Button } from "@/components/ui/button"

Spinner#

Render a <Spinner /> component inside the button to show a loading state. Remember to add the data-icon="inline-start" or data-icon="inline-end" attribute to the spinner for the correct spacing.

import { Button } from "@/components/ui/button"
import { Spinner } from "@/components/ui/spinner"

Button Group#

To create a button group, use the ButtonGroup component. See the Button Group documentation for more details.

"use client"

import * as React from "react"

As Link#

You can use the buttonVariants helper to make a link look like a button.

Do not use <Button render={<a />} nativeButton={false} /> for links. The Base UI Button component always applies role="button", which overrides the semantic link role on <a> elements. Use buttonVariants with a plain <a> tag instead.

Login
import { buttonVariants } from "@/components/ui/button"

export function ButtonRender() {

RTL#

To enable RTL support, see the RTL configuration guide.

"use client"

import { ArrowRightIcon, PlusIcon } from "@phosphor-icons/react"

API Reference#

Button#

The Button component is a wrapper around the button element that adds a variety of styles and functionality.

PropTypeDefault
variant"default" | "outline" | "ghost" | "destructive" | "secondary" | "link""default"
size"default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg""default"
BubbleButton Group

On This Page

InstallationUsageCursorSizeDefaultOutlineSecondaryGhostDestructiveLinkIconWith IconRoundedSpinnerButton GroupAs LinkRTLAPI ReferenceButton