# Buttons · Divan

> Capsules, never outlined. One filled copper button per view.

Part of Divan, the DivanWorks design system. Web page: https://brand.divanworks.com/buttons · All topics: https://brand.divanworks.com/llms.txt

## Rules

- variant default (filled copper): the main action. tinted: a second important action. secondary: gray, everything else. ghost: toolbars, lists, the header. plain: copper text. destructive: a soft red fill for anything negative or sensitive (disconnect, delete, remove, block, reject, end, sign out); when it can’t easily be undone, put it behind ConfirmButton or ask().
- Sizes: xs 28px, sm 32px, default 36px, lg 44px; icon, icon-sm, icon-lg for icon-only buttons, which always have aria-label.
- Forward arrows get rtl:-scale-x-100.
- A disabled button always has a faint caption beside it that says what makes it available.
- A press that takes a moment shows it on the button: a spinner in place of its first icon, from 150 ms after the press until the work is done, and a second press meanwhile does nothing. A Button does it by itself for a page it opens, a form it sends (enhance from #lib/forms.js) and a promise its onclick returns; pending={busy} for anything else.

## Components

### Button

Every pressable action. One variant="default" (filled copper) per view. Anything with a negative or sensitive meaning (disconnect, delete, remove, block, reject, end, sign out) is variant="destructive": its own soft red fill, never gray or copper with red text. While what it started is at work (a page it opens, a form it sends, a promise its onclick returns) it shows a spinner by itself; pending={busy} for anything else.

```ts
import { Button } from '#lib/components/ui/button/index.js';
```

```svelte
<Button>Support Us</Button>
<Button variant="secondary">Copy Code</Button>
<Button variant="plain" size="sm">Try Again</Button>
<Button variant="destructive">Disconnect</Button>
<Button href="/fa/campaigns" variant="ghost">Campaigns</Button>
```
