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

Dialog & modal

Controlled dialogs with title, footer actions, and stacked multi-step flows.
Updated 19d ago
Decoration layers
Toast & feedback
5 min · Pattern
Dialogs focus attention on a decision or input. In Once UI they are controlled components with title, optional footer actions, and stack support for multi-step flows.

When to use

Reach for Dialog when the user must confirm, decide, or enter data before continuing:
  • Delete confirmations
  • Settings that need focus
  • Multi-step wizards (stacked dialogs)
  • Forms too important to tuck into a page section
For lightweight status messages, use Toast & feedback instead.

Basic dialog

Dialogs are controlled — you own isOpen state and pass onClose:
const [isOpen, setIsOpen] = useState(false);

<>
  <Button onClick={() => setIsOpen(true)}>Open dialog</Button>

  <Dialog
    isOpen={isOpen}
    onClose={() => setIsOpen(false)}
    title="Rename project"
    description="Choose a name your team will recognize."
  >
    <Column gap="16" fillWidth marginTop="12">
      <Input id="project-name" label="Project name" fillWidth />
    </Column>
  </Dialog>
</>
Prop
Role
`isOpen`Show or hide the overlay
`onClose`Called when user dismisses (Escape, clickaway, close button)
`title`Primary heading — required
`description`Optional supporting text below the title
`children`Body content — forms, text, any layout

Footer actions

Put primary and secondary actions in footer, not loose in the body:
<Dialog
  isOpen={isOpen}
  onClose={() => setIsOpen(false)}
  title="Delete workspace?"
  description="This cannot be undone. All projects will be removed."
  footer={
    <Row gap="8">
      <Button variant="secondary" onClick={() => setIsOpen(false)}>
        Cancel
      </Button>
      <Button variant="danger" onClick={handleDelete}>
        Delete
      </Button>
    </Row>
  }
>
  <Text variant="body-default-s" onBackground="neutral-weak">
    Type the workspace name to confirm.
  </Text>
</Dialog>
Use variant="secondary" for cancel and the semantic variant (danger, primary) for the committing action.

Stacked dialogs

For multi-step flows, open a second dialog on top of the first with stack:
<Dialog
  isOpen={isBaseOpen}
  onClose={() => setIsBaseOpen(false)}
  title="Step 1 — Details"
  footer={<Button onClick={() => setIsStackedOpen(true)}>Next</Button>}
>
  ...
</Dialog>

<Dialog
  isOpen={isStackedOpen}
  onClose={() => setIsStackedOpen(false)}
  title="Step 2 — Confirm"
  stack
  footer={<Button onClick={handleFinish}>Finish</Button>}
>
  ...
</Dialog>
The stack prop tells Once UI to layer this dialog above the base dialog with correct z-index and backdrop.

Write this / not this

✅ Once UI way
❌ Common mistake
Controlled `isOpen` + `onClose`Uncontrolled open state inside Dialog
Actions in `footer`Buttons floating in `children` without structure
`Column gap="16"` for form bodyNested `Flex direction="column"`
`stack` for step 2+Replacing step 1 content in place

Check yourself

  • title is set on every dialog
  • Cancel and confirm live in footer
  • onClose resets local form state if needed
  • Destructive actions use variant="danger"

Related

→ Form layout → Toast & feedback → Full reference: docs.once-ui.com — Dialog