import { Button } from "@components/Button";
import { TabProvider, TabTrigger, TabContent, TabList } from "@components/Tabs";
import { Story } from "@/components/Story";
import { LoadedCode } from "@/components/LoadedCode";
# Button
Displays a button or a component that looks like a button.
Preview
Code
```tsx
import { Button } from "@components/Button";
export function ButtonDemo() {
return
}
```
## Installation
1. Create a new file `Button.tsx` in your component folder.
2. Copy and paste the following code into the file.
## Usage
```tsx
import { Button } from "@components/Button";
```
```html
```
## Props
### Variants
| Prop | Type | Default | Description |
| :--- | :--- | :------ | :---------- |
| `size` | `"link" \| "sm" \| "md" \| "lg" \| "icon"` | `"md"` | The size of the button |
| `border` | `"none" \| "solid" \| "success" \| "warning" \| "danger"` | `"solid"` | The border color of the button |
| `background` | `"default" \| "ghost" \| "success" \| "warning" \| "danger" \| "transparent"` | `"default"` | The background color of the button |
| `decoration` | `"none" \| "link"` | `"none"` | The inner text decoration of the button |
| `presets` | `"default" \| "ghost" \| "link" \| "success" \| "warning" \| "danger"` | `"default"` | The preset of the variant props |
### Special
| Prop | Type | Default | Description |
| :--- | :--- | :------ | :---------- |
| `asChild` | `boolean` | `false` | Whether the button is rendered as a child of a component |
## Examples
### Default
Preview
Code
```tsx
import { Button } from "@components/Button";
export function ButtonDemo() {
return
}
```
### Ghost
Preview
Code
```tsx
import { Button } from "@components/Button";
export function ButtonDemo() {
return
}
```
### Link
Preview
Code
```tsx
import { Button } from "@components/Button";
export function ButtonDemo() {
return
}
```
### Success
Preview
Code
```tsx
import { Button } from "@components/Button";
export function ButtonDemo() {
return
}
```
### Warning
Preview
Code
```tsx
import { Button } from "@components/Button";
export function ButtonDemo() {
return
}
```
### Danger
Preview
Code
```tsx
import { Button } from "@components/Button";
export function ButtonDemo() {
return
}
```