# Button > A button with gradient variants built on Base UI URL: https://prototyper-ui.com/docs/components/button Base UI reference: https://base-ui.com/react/components/button ```tsx import { Button } from "@/components/ui/button" export default function ButtonDemo() { return } ``` ## Installation ```bash pnpm dlx shadcn@latest add https://prototyper-ui.com/r/button.json ``` This will add the following files to your project: - `components/ui/button.tsx` ## Usage ```tsx import { Button } from "@/components/ui/button" ``` ## Examples ### Destructive ```tsx import { Button } from "@/components/ui/button" export default function ButtonDestructive() { return } ``` ### Outline ```tsx import { Button } from "@/components/ui/button" export default function ButtonOutline() { return } ``` ### Secondary ```tsx import { Button } from "@/components/ui/button" export default function ButtonSecondary() { return } ``` ### Ghost ```tsx import { Button } from "@/components/ui/button" export default function ButtonGhost() { return } ``` ### Link ```tsx import { buttonVariants } from "@/components/ui/button" export default function ButtonLink() { return Link } ``` ### Icon ```tsx import { ChevronRight } from "lucide-react" import { Button } from "@/components/ui/button" export default function ButtonIcon() { return ( ) } ``` ### With Icon ```tsx import { Mail } from "lucide-react" import { Button } from "@/components/ui/button" export default function ButtonWithIcon() { return ( ) } ``` ### Loading ```tsx import { Loader2 } from "lucide-react" import { Button } from "@/components/ui/button" export default function ButtonLoading() { return ( ) } ``` ### Press ```tsx import { Button } from "@/components/ui/button" export default function ButtonPress() { return } ``` ## Styling ### Data Slots Use `data-slot` attributes to target the button in CSS: | Slot name | Element | | --------- | ------------------- | | `button` | The ` ``` ## API Reference ### Button A clickable button element with gradient variants. | Prop | Type | Default | Description | | --- | --- | --- | --- | | `variant` | `"default" \| "destructive" \| "outline" \| "secondary" \| "ghost" \| "link"` | `"default"` | Visual style variant | | `size` | `"default" \| "xs" \| "sm" \| "lg" \| "icon" \| "icon-xs" \| "icon-sm" \| "icon-lg"` | `"default"` | Size of the button | | `isPending` | `boolean` | - | Shows pending state and sets aria-disabled | | `className` | `string` | - | Additional CSS classes | | `children` | `React.ReactNode` | - | Button content | All [Base UI Button props](https://base-ui.com/react/components/button) are forwarded via `...props`. ### buttonVariants A `cva` helper exported for use outside of the `