Feedback
Toast
A short message at the bottom of the window. Up to three in a stack; an error stays until it is closed.
Feedback
A short message at the bottom of the window. Up to three in a stack; an error stays until it is closed.
Change the options on the right, then show the toast. Leave actionLabel empty for no action.
import { toast } from 'omuk-ui/sonner';
toast.success('Invite sent', {
description: 'Ada can join until Friday.',
});One Toaster near the root of the app. toast has the same calls as the sonner package, so code written for sonner works as it is.
import { Toaster } from 'omuk-ui/sonner';
// Once, near the root of the app. Then `toast(…)` from anywhere.
export function AppToaster() {
return <Toaster />;
}Six places, from 640 wide up: the top or the bottom, at the left, the centre or the right. At the top the stack grows down. On a phone the toasts are always centred.
<Toaster position="bottom-right" />An icon only where it helps: done, working, failed. An error stays until it is closed; the others leave after four seconds.
One action button, such as Undo. toast.promise shows a spinner while the work runs, then turns into the success or the error.
The second argument of toast(), toast.success() and the others.