# Button A button or a component that looks like a button. ## Installation Start from a Svelte 5 application, then install the component package, shared theme, and Bits UI peer: ```bash pnpm add coss-svelte @coss-svelte/theme bits-ui ``` Import `@coss-svelte/theme/style-coss.css` after Tailwind from the application's global stylesheet. ## Usage ```svelte ``` ## Anatomy - `Button` ## API Reference ### Button A button or a component that looks like a button. **Signatures** - `{ href: string; type?: undefined; target?: HTMLAttributeAnchorTarget \| null; download?: any; form?: undefined; disabled?: undefined }` - `{ href?: undefined; type?: "submit" \| "reset" \| "button" \| null; target?: undefined; download?: undefined; form?: string \| null; disabled?: boolean \| null }` | Prop | Type | Default | Description | | --- | --- | --- | --- | | `variant` | `"link" \| "primary" \| "secondary" \| "outline" \| "ghost" \| "destructive" \| "destructive-outline" \| "default"` | `"default"` | Visual variant for the component. | | `size` | `"default" \| "md" \| "xs" \| "sm" \| "lg" \| "xl" \| "icon" \| "icon-xs" \| "icon-sm" \| "icon-lg" \| "icon-xl"` | `"default"` | Size variant for the component. | | `href` | `string` | `""` | Renders the component as a link target when provided. | | `type` | `"submit" \| "reset" \| "button" \| null` | `"button"` | Behavior, selection, or HTML type passed to the underlying control. | | `loading` | `boolean` | `false` | Shows the loading indicator and disables the button. | | `disabled` | `boolean \| null` | `false` | Disables interaction with the control. | **Composition and refs** - `children: Snippet<[]>` Inherits from [Svelte /