Skip to content
synccn

Button

Seven variants, four sizes and a built-in loading state.

Playground

Change the props and copy the code. The controls come from the component's TypeScript types.

Props

variant
size
import { Button } from "@/components/ui/button";<Button>Save changes</Button>

Installation

$ pnpm dlx shadcn@latest add @synccn/button

First time in this project? Connect synccn with one command.

Usage

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

API reference

Generated from the component's TypeScript types, so it always matches the code.

  • variant
    "default" | "secondary" | "outline" | "ghost" | "destructive" | "link" | "soft"

    Default "default"

    Visual style.

  • size
    "sm" | "default" | "lg" | "icon" | "icon-sm"

    Default "default"

    Height and padding.

  • loading
    boolean

    Default false

    Shows a spinner and disables the button.

  • className
    string

    Extra classes for the root element.

  • children
    React.ReactNode

    Content to render.

Also accepts every standard <button> attribute, and forwards its ref.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Accessibility

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA attributes: aria-busy
  • Shows a visible focus ring for keyboard users