Skip to main content

Toast

Available anywhere inside UIProvider.
In a browser window at least 1024 px wide with a mouse, toasts sit in the bottom-right corner. Everywhere else they appear at the bottom center. duration is in milliseconds, default 3000 (5000 with an action); 0 keeps the toast until dismissed. variant is default, success or danger. action: { label, onPress } adds a button, such as “View” or “Retry”; pressing it dismisses the toast.

Undo instead of confirm

For anything that can be put back, offer undo instead of asking first, the way mail apps do. Change the screen right away, then call undoable. The real work runs only once the toast is gone without an undo.
() => Promise<unknown> | void
required
The real work, such as the API delete. Runs when the toast times out.
() => void
required
Put the screen back. Called on undo, and when commit throws.
string
default:"'Undo'"
Button text.
number
default:"5000"
How long undo is offered, in ms.
string
Shown if commit fails, after undo has run.
If the page closes while the toast is up, commit runs on pagehide. That is best effort: a request started then may not finish. For edits that must survive going offline, make the offline queue the commit: commit: () => outbox.add(op).

Skeleton

Placeholder shapes while content loads.
Props: width?, height? (default 16), circle?, radius?. Three shapes cover most loading states. Match the layout the content will have, so nothing jumps when it arrives.

Spinner

size defaults to 20. It inherits the current text color.

ProgressBar

number
From 0 to 1 (or to max). Omit for an indeterminate bar.
number
Upper bound for value.
number
default:"8"
Track thickness in px.
string
Fill color. Defaults to the primary token.
boolean
Show the percentage.
ReactNode
Label above the bar.
For inline messages, see Callout; for empty lists, EmptyState.

LoadingScreen and CenterScreen

LoadingScreen is what your app shows while auth or its first read resolves: a centered spinner on the page background.
LoadingScreen takes background?, color? (the spinner’s arc), size? (default 28), label? (spoken while waiting) and children to draw your own splash instead of the spinner. CenterScreen is the full-screen centered layout it is built on, for sign-in prompts, gates and splashes; it takes background? and any <div> attribute.

LoadMore

The foot of a paged list. It loads the next page as it scrolls into view, and keeps a button as the fallback for lists too short to scroll.
boolean
required
Renders nothing when false.
() => void
required
Load the next page.
boolean
A page is loading.
boolean
The last page failed. Automatic loading stops and the button turns into a retry.
boolean
default:"true"
Load as the foot scrolls into view. Turn it off where the page shouldn’t grow under the reader.
string
default:"'0px 0px 600px 0px'"
How far ahead of the viewport loading starts.
ReactNode
A small line under the button, such as “12 / 48”.
object
Text overrides: more, retry.