--- title: Button description: Displays a button or a component that looks like a button. featured: true base: base component: true --- ## Installation Command Manual ```bash npx shadcn@latest add button ``` Install the following dependencies: ```bash npm install @base-ui/react ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage ```tsx import { Button } from "@/components/ui/button" ``` ```tsx ``` ## Cursor Tailwind v4 [switched](https://tailwindcss.com/docs/upgrade-guide#buttons-use-the-default-cursor) 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: ```css showLineNumbers title="globals.css" @layer base { button:not(:disabled), [role="button"]:not(:disabled) { cursor: pointer; } } ``` ## Examples ### Size Use the `size` prop to change the size of the button. ### Default ### Outline ### Secondary ### Ghost ### Destructive ### Link ### Icon ### With Icon Remember to add the `data-icon="inline-start"` or `data-icon="inline-end"` attribute to the icon for the correct spacing. ### Rounded Use the `rounded-full` class to make the button rounded. ### Spinner Render a `` 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. ### Button Group To create a button group, use the `ButtonGroup` component. See the [Button Group](/docs/components/base/button-group) documentation for more details. ### Link You can use the `buttonVariants` helper to make a link look like a button. **Do not use `