Once UI Handbook
Beginner Guides
What is Once UI?
Install & config
Page skeleton
Your first page
Build And Launch
How to launch a portfolio site that actually gets you hired
How to build a documentation site with MDX and Next.js
How to ship a landing page and dashboard with authentication in Next.js
How to launch a social app with Next.js and Supabase
Vibe Coding
Introduction to vibe coding
Set up your local dev environment
Essential tools for vibe coding
Build your first Once UI app
Common Patterns
Hero section
Static panel
Form layout
Highlighted card
Responsive stacking
Decoration layers
Dialog & modal
Toast & feedback
Tables & lists
Loading states
App shell navigation
Dashboard & charts
Chat & messaging
Auth & verification
Settings & split panels
Data filters & toolbar
Command palette
Pricing & plans
Accordion & FAQ
Media & uploads
Empty & error states
SEO, Open Graph, and structured data
Documentation code blocks with live preview
Carousels, galleries, and before/after comparisons
Date pickers and scheduling
Context menus and dropdown actions
Tags, chips, and multi-value inputs
Roadmap & kanban
Form inputs & controls
Progress, status & badges
Scrolling & feeds
Profile, avatars & identity
Social proof & logo clouds
Masonry & media grids
Table pagination, search & bulk selection
Banners & announcements
Footer layouts
Onboarding & first run
Waitlist & coming soon
Design Tips
Color & surfaces
Harness overview
Row, Column & Grid
Spacing & rhythm
Icons & buttons
Reveal & motion
Theme tokens, FOUC-free init, and runtime style controls
Tooltips and hover cards
Block updates
Block updates changelog
Agent Resources
Column, not Flex
Semantics over CSS
Typography scale
Common gotchas
Block anchors
Validate generated code
Pro block registry
Match task bundles
TrademarkTrademark
Ctrl k
Search...
Sign up
Once UI Handbook
Beginner Guides
What is Once UI?
Install & config
Page skeleton
Your first page
Build And Launch
How to launch a portfolio site that actually gets you hired
How to build a documentation site with MDX and Next.js
How to ship a landing page and dashboard with authentication in Next.js
How to launch a social app with Next.js and Supabase
Vibe Coding
Introduction to vibe coding
Set up your local dev environment
Essential tools for vibe coding
Build your first Once UI app
Common Patterns
Hero section
Static panel
Form layout
Highlighted card
Responsive stacking
Decoration layers
Dialog & modal
Toast & feedback
Tables & lists
Loading states
App shell navigation
Dashboard & charts
Chat & messaging
Auth & verification
Settings & split panels
Data filters & toolbar
Command palette
Pricing & plans
Accordion & FAQ
Media & uploads
Empty & error states
SEO, Open Graph, and structured data
Documentation code blocks with live preview
Carousels, galleries, and before/after comparisons
Date pickers and scheduling
Context menus and dropdown actions
Tags, chips, and multi-value inputs
Roadmap & kanban
Form inputs & controls
Progress, status & badges
Scrolling & feeds
Profile, avatars & identity
Social proof & logo clouds
Masonry & media grids
Table pagination, search & bulk selection
Banners & announcements
Footer layouts
Onboarding & first run
Waitlist & coming soon
Design Tips
Color & surfaces
Harness overview
Row, Column & Grid
Spacing & rhythm
Icons & buttons
Reveal & motion
Theme tokens, FOUC-free init, and runtime style controls
Tooltips and hover cards
Block updates
Block updates changelog
Agent Resources
Column, not Flex
Semantics over CSS
Typography scale
Common gotchas
Block anchors
Validate generated code
Pro block registry
Match task bundles
TrademarkTrademark
Once UIDocumentationBlog
© Once UI. All rights reserved.
Built with Aveiro

Toast & feedback

Global toast notifications via ToastProvider and useToast — plus when to use inline Feedback.
Updated 19d ago
Dialog & modal
Tables & lists
4 min · Pattern
Toasts are ephemeral status messages. Wrap your app in ToastProvider once, then call useToast() from any component — no prop drilling.

Setup (once per app)

Add the toast provider inside your app providers stack — the same place you configure theme and icons. See the ToastProvider guide for the full provider tree. At minimum you need:
  • A ToastProvider wrapper at the app root (inside theme providers)
  • Optional s="top" to place toasts at the top on small screens

Trigger a toast

From any client component, import and call the toast hook:

Variants

Variant
Use for
`success`Completed actions — saved, copied, sent
`danger`Errors — failed save, network error
`warning`Caution — unsaved changes, quota near limit
`info`Neutral updates — background sync, tips

Inline Feedback vs toast

Once UI has two feedback surfaces — pick the right one:
Surface
When
Example
`<Feedback>`Persistent context on the pageLesson intro callouts, form section hints
`useToast()`Transient result of an action"Copied to clipboard", "Upload failed"
This page's header uses <Feedback> — that's intentional. Toasts disappear after a few seconds.

Toast with action

Add a follow-up action when the user might want to undo: Keep actions short — one verb, size="s".

Write this / not this

✅ Once UI way
❌ Common mistake
Toast provider at app rootMounting a new provider per page
`useToast()` hookCustom fixed-position divs
Semantic `variant`Hard-coded green/red hex colors
Short `message` stringParagraph-length toast text

Check yourself

  • Toast provider wraps the app (not individual routes)
  • Success and error paths both show feedback
  • Messages are one line — details belong in a Dialog or inline Feedback

Related

→ Dialog & modal → Install & config → Full reference: docs.once-ui.com — ToastProvider
import { useToast } from "@once-ui-system/core";

function SaveButton() {
  const { addToast } = useToast();

  return (
    <Button
      onClick={() =>
        addToast({
          variant: "success",
          message: "Settings saved",
        })
      }
    >
      Save
    </Button>
  );
}
addToast({ variant: "danger", message: "Could not delete item" });
addToast({ variant: "warning", message: "You have unsaved changes" });
addToast({ variant: "info", message: "Syncing in the background" });
addToast({
  variant: "success",
  message: "File moved to trash",
  action: (
    <Button size="s" variant="secondary" onClick={handleUndo}>
      Undo
    </Button>
  ),
});