Button
The one button: six variants, four text sizes and four square icon sizes, plus button groups.
Available in
Angular: available Vue: available React: available React Native: available
Usage
<div class="demo-stack">
<div class="demo-row">
<button soneBtn type="button">Default</button>
<button soneBtn type="button" variant="accent">Accent</button>
<button soneBtn type="button" variant="secondary">Secondary</button>
<button soneBtn type="button" variant="soft">Soft</button>
<button soneBtn type="button" variant="outline">Outline</button>
<button soneBtn type="button" variant="ghost">Ghost</button>
<button soneBtn type="button" variant="destructive">Destructive</button>
<button soneBtn type="button" variant="link">Link</button>
</div>
<div class="demo-row">
<button soneBtn type="button" size="xs">Extra small</button>
<button soneBtn type="button" size="sm">Small</button>
<button soneBtn type="button">Default</button>
<button soneBtn type="button" size="lg">Large</button>
<button soneBtn type="button" disabled>Disabled</button>
</div>
<div class="demo-row" style="align-items: center">
<button soneBtn type="button" variant="ghost" size="icon" aria-label="Share"><sone-icon icon="share" /></button>
<button soneBtn type="button" variant="soft" size="icon" aria-label="Settings"><sone-icon icon="settings" /></button>
<button soneBtn type="button" variant="outline" size="icon" aria-label="Copy"><sone-icon icon="copy" /></button>
<!-- Toggle buttons: aria-pressed="true" draws the pressed fill -->
<button soneBtn type="button" variant="ghost" size="icon" aria-label="Star"
[attr.aria-pressed]="starred()" (click)="starred.set(!starred())"><sone-icon icon="star" /></button>
<button soneBtn type="button" variant="outline" size="icon" aria-label="Pin to sidebar"
[attr.aria-pressed]="pinned()" (click)="pinned.set(!pinned())"><sone-icon icon="bookmark" /></button>
</div>
<div soneButtonGroup>
<button soneBtn type="button" variant="outline">Day</button>
<button soneBtn type="button" variant="outline">Week</button>
<button soneBtn type="button" variant="outline">Month</button>
</div>
</div>Import
import {
SoneButtonDirective,
SoneButtonGroupDirective,
} from "@surface-one/angular/button";API reference
SoneButtonDirectiveDirective
| Name | Type | Default |
|---|---|---|
variant`accent`: filled with the accent (the primary call to action where `default` is ink). `soft`: a translucent grey fill (a quiet icon button). A toggle button with `aria-pressed="true"` gets the pressed fill in `ghost`, `outline` (keeping its border) and `soft`. | ButtonVariant | "default" |
size | ButtonSize | "default" |
SoneButtonGroupDirectiveDirective
| Name | Type | Default |
|---|---|---|
orientation | "horizontal" | "vertical" | "horizontal" |