Feedback
Tags, callouts, progress, spinners, empty states and toasts tell people what is going on. Every state color comes with words, never alone.
Tag 01
<span class="ap-c-tag ap-c-tag--success">Ready</span>
<span class="ap-c-tag ap-c-tag--danger ap-c-tag--solid" aria-label="3 unread messages">3</span>
<span class="ap-c-tag" style="--ap-tag-tone: var(--ap-palette-indigo)">Factions</span>
Tones: --accent, --success, --warning, --danger, --info; add --solid to fill. A count works as a badge: give it a name that says what is counted.
| Token | Default |
|---|---|
--ap-tag-tone | var(--ap-text-muted) |
--ap-tag-ink | var(--ap-bg) |
--ap-tag-bg | color-mix(in oklab, var(--_tone) 16%, transparent) |
--ap-tag-fg | var(--ap-text) |
--ap-tag-border-color | var(--_tone) |
--ap-tag-padding-block | var(--ap-space-xxs) |
--ap-tag-padding-inline | var(--ap-space-sm) |
--ap-tag-gap | var(--ap-space-xs) |
--ap-tag-radius | var(--ap-radius-pill) |
Callout 02
<aside class="ap-c-callout ap-c-callout--warning" aria-labelledby="fuel">
<h3 class="ap-c-callout__title" id="fuel">Low fuel</h3>
<p>Two jumps left before the reserve.</p>
</aside>
| Token | Default |
|---|---|
--ap-callout-tone | transparent |
--ap-callout-bg | var(--ap-surface-1) |
--ap-callout-fg | var(--ap-text) |
--ap-callout-title-color | var(--ap-text) |
--ap-callout-bar-width | 0 |
--ap-callout-padding | var(--ap-space-lg) |
--ap-callout-gap | var(--ap-space-sm) |
--ap-callout-radius | var(--ap-radius-card) |
Progress 03
<progress class="ap-c-progress" max="100" value="40">40%</progress>
<progress class="ap-c-progress" aria-label="Downloading charts"></progress> <!-- indeterminate -->
A native <progress>: without a value it is indeterminate. For discrete levels use the segmented meter.
| Token | Default |
|---|---|
--ap-progress-fill | var(--ap-accent) |
--ap-progress-track | var(--ap-surface-3) |
--ap-progress-height | var(--ap-space-sm) |
--ap-progress-radius | var(--ap-radius-pill) |
--ap-progress-duration | calc(var(--ap-duration-slow) * 5) |
Spinner 04
<span class="ap-o-cluster ap-o-cluster--gap-sm" role="status">
<span class="ap-c-spinner" aria-hidden="true"></span> Plotting course…
</span>
The ring is decorative: the text in the role="status" region says what is happening. Modifiers: --sm, --lg, --spectrum.
| Token | Default |
|---|---|
--ap-spinner-size | var(--ap-size-icon) |
--ap-spinner-thickness | var(--ap-border-width-strong) |
--ap-spinner-arc | conic-gradient(var(--ap-accent) 0 25%, var(--ap-border-subtle) 0) |
--ap-spinner-duration | calc(var(--ap-duration-slow) * 3) |
Empty state 05
No transmissions
Nobody has hailed the ship in this cycle. Open a channel to call the nearest station.
<section class="ap-c-empty-state" aria-labelledby="inbox-empty">
<svg class="ap-c-empty-state__icon" aria-hidden="true">…</svg>
<h3 class="ap-c-empty-state__title" id="inbox-empty">No transmissions</h3>
<p class="ap-c-empty-state__text">Nobody has hailed the ship in this cycle.</p>
</section>
| Token | Default |
|---|---|
--ap-empty-state-gap | var(--ap-space-md) |
--ap-empty-state-padding | var(--ap-space-xl) |
--ap-empty-state-border-color | var(--ap-border) |
--ap-empty-state-radius | var(--ap-radius-card) |
--ap-empty-state-bg | transparent |
--ap-empty-state-icon-size | var(--ap-size-control-lg) |
--ap-empty-state-icon-color | var(--ap-text-subtle) |
--ap-empty-state-title-color | var(--ap-text) |
--ap-empty-state-text-color | var(--ap-text-muted) |
--ap-empty-state-text-max | 48ch |
Toast 06
import { createToaster } from 'astrostyle/js/toast'
const toaster = createToaster()
toaster.show({ title: 'Docked', message: 'All systems are back online.', tone: 'success' })
toaster.show({ message: 'Cargo sold.', action: { label: 'Undo', onClick: undoSale } })
toaster.show({ title: 'Hull breach', message: 'Seal deck 3.', tone: 'danger', urgent: true, duration: 0 })
Toasts close after five seconds; hovering or focusing one stops the clock. Up to three are shown at once, the rest wait. urgent toasts use role="alert"; the others are read politely. Never put the only way to do something in a toast.
| Token | Default |
|---|---|
--ap-toast-tone | transparent |
--ap-toast-bg | var(--ap-surface-1) |
--ap-toast-fg | var(--ap-text) |
--ap-toast-border-color | var(--ap-border) |
--ap-toast-bar-width | 0 |
--ap-toast-radius | var(--ap-radius-control) |
--ap-toast-shadow | var(--ap-elevation-overlay) |
--ap-toast-padding | var(--ap-space-md) |
--ap-toast-gap | var(--ap-space-sm) |
--ap-toast-offset | var(--ap-space-lg) |
--ap-toast-width | 24rem |
--ap-toast-duration | var(--ap-duration-base) |