Raft Design System

Components · Overlays

Dialog

A centered overlay on a scrim for a decision or a few fields people must finish before they continue, with a wide size for a large form filled in one pass.

StableAlso called Modal
import { Dialog } from "@botiverse/raft-ui";

A dialog is a centered overlay on a scrim for something people must finish before they continue: a decision, or a small task of a few fields, such as creating a channel. It has a title, a body and at most two buttons. Its wide size holds a large form filled in one pass. A confirmation is a Dialog too, at size="sm", whether the action can be undone or not; AlertDialog is only for the few confirmations a product lists (Choosing a component, 2026-11-03).

dialog/compositions/create-channel

When to use

SituationUse
A small task in 1 to 5 fields (Create channel)Dialog
A large form filled in one pass: registering or editing an app, configuring an agentDialog with size="wide"
Task details; sending a prompt to an agentA workspace overlay on Dialog, 960px wide and full screen on a phone, outside the four sizes (Variants, Tasks)
A few ways to do one thing, each needing a line of explanation to choose betweenA chooser: a small Dialog of ListRows, one per way (A chooser). When the names alone are enough, a DropdownMenu
Confirming an action that cannot be undone, or that interruptsDialog with size="sm", its confirm button colored by the consequence (Rules). AlertDialog only where the product lists it: in Raft Chat, discarding unsaved edits to an agent's profile and opening a link that hands off to another app (Raft Chat)
An action that can be reversed in placeNo dialog: do it; when a Toast offers Undo is in Feedback
Details or settings people look at and edit for a whileDrawer

Which overlay fits which job is in Choosing a component.

Anatomy

  • Dialog: the root. Owns the open state. Required.
  • DialogTrigger: the button that opens it.
  • DialogContent: the centered surface, portaled, with the scrim (DialogOverlay) behind it. Required. On a desktop and a tablet, placement="top" puts its top edge near the top of the window instead of the middle (At the top).
  • DialogHeader: the title row, with an optional DialogClose at its end. The × is pulled out so its icon box, not the button, ends on the dialog's margin (--surface-inset: 20px, 16px with a mouse) (Alignment).
  • DialogTitle: the title. Required.
  • DialogDescription: a helper sentence under the title or in the body, in foreground-muted, only for a consequence (consequence), who sees it or whom it affects (audience), or how to recover (recovery). It takes only a HelperText, made with helperText(content, { why, about }), and renders its why and about as data-why and data-about (Writing › Helper text).
  • DialogBody: the content, in the base ink (foreground). Numbered steps ("Step 1 of 2: name the computer") are body text here, not a description. It scrolls when the dialog reaches the window height, natively, or under raft-ui's scrollbar with unstable_scrollArea (Scrolling in a ScrollArea).
  • DialogFooter: the buttons in one row at the end, with a note or a TextLink at its start. It stacks them only when they don't fit on one line (The footer).
  • DialogFooterNote (@botiverse/raft-ui/wip): one short line at the start of the footer that says what the commit button will do, in muted footnote text. It takes a HelperText, as DialogDescription does ("You'll be billed $8 for each new member", consequence). Only in a size="lg" or size="wide" dialog. An empty note draws nothing.
  • DialogClose: closes the dialog. Without children it is the × icon button; with render it turns a Cancel button into a close button.
  • DialogNav: the section list of a wide dialog.
  • DialogSurface: the dialog's frame without Base UI behind it, for a centered modal whose app owns the backdrop, Esc and focus, such as a step of the server setup. Prefer DialogContent: search moved off DialogSurface onto it (slock #14142).
  • DialogPortal and DialogOverlay: lower-level parts.
  • DialogSheetContent: DialogContent for a dialog that becomes a sheet on a phone (On a phone). On a desktop and a tablet it is DialogContent, the same markup.
  • DialogCommit: the dialog's one commit button, a Button written at the end of DialogFooter. In a sheet on a phone it is drawn at the end of the head instead.
  • DialogSheetBack: Back at the start of a sheet's head, in a later step of a flow. It draws nothing outside a sheet. On a touch screen it goes back when the finger lifts (Switching on finger lift).

Variants

Pick the size by what the dialog holds, not by what looks right. The four sizes are far enough apart that each holds one kind of content (cindyz, 2026-10-21):

VariantWidthUse for
size="sm"400pxA decision: every confirmation and acknowledgement, including one with a few options to choose from or a short list of what it affects (Reset agent, Change visibility, the restart options). It is the width of AlertDialog
size="md" (default)448pxA small task: 1 to 5 fields, a list to pick from, a short help text that is only read (Create channel, Add members, role help)
size="lg"640pxContent that needs width: a list with several columns, a command or code, key-value rows, a long text to read, a flow of steps (Connect computer, a computer's release notes)
size="wide"896pxThe large form dialog, in sections, with a fixed height of 760px or the window height less 32px, whichever is smaller
  • Every confirmation is one width, 400px, whether it is built on Dialog or AlertDialog. A confirmation whose content no longer fits 400px isn't a confirmation any more: it is a small task, at md.
  • sm, md and lg are the small dialog: its height follows its content, up to the window less 32px, and a click on the scrim closes it. wide is the large form dialog.
  • Set the width with size only. Product code never passes its own max-w-* to DialogContent. Content that fits none of the four sizes isn't a dialog: make it a page or a Drawer.
  • Only these overlays have a width outside the four sizes, each set by its own rule. Nothing else may add one:
    • Task details and Send prompt, 960px wide (or the window less 32px) and at most 900px or 86% of the window high, whichever is smaller, full screen on a phone: workspace overlays. Task details is in Tasks. Send prompt hands a prompt to one agent, drawn as the DM with it: the agent in the head with a switch to pick another, the last 5 messages of the DM, read only, and the real composer with the prompt filled in (cindyz, 2026-11-23, #proj-raft-ui:#297; slock #16396).
    • Search, 720px, a DialogContent with placement="top", its top edge over the top bar's field through --dialog-top (At the top, Search).
    • The showcase frame, 720px wide and about 520px high, shared by steps 3 to 5 of onboarding, the Upgrade to Pro dialog and Pro's Add seats dialog (cindyz, 2026-10-26: adding seats is a paywall, like upgrading), and used by nothing else (Onboarding).
    • AnnouncementDialog, 576px: its picture and one-paragraph text read best there; at 640px the text runs past 80 characters a line.
    • An attachment preview, as wide as the file needs, up to 768px.
  • On a narrow screen every size is as wide as itself or the window less 32px, whichever is smaller, so at 390px each one is 358px wide. Its height and the wide dialog's sections are in Behavior.

Deleting something large, such as an agent or a server, also asks for its name to be typed (Forms). It is still a confirmation, at sm, with the confirm button red (AlertDialog):

dialog/compositions/typed-delete

The large form dialog uses bar on DialogHeader, DialogBody and DialogFooter: the header and footer stay in place and the body scrolls between them. The body holds DialogNav on the left, a line-seam after it, and one FormSection per section on the right, in a pane that scrolls and pads its content by --surface-inset on every side, the top included: a section starts flush, so the pane keeps the first one clear of the header. Its structure and rules are in Forms.

A chooser

A chooser is a small dialog whose only content is a short list of ways to do one thing, such as Add members › Add agent, with Create agent and Connect an external agent (Kirby, 2026-11-24, #triage:#619, asked for by cindyz).

  • Make each way a ListRow in an inset ListRowGroup: variant="plain", a small icon, the way's name, a ListRowSubtitle that says what it is, and ListRowChevron.
  • Clicking a row closes the chooser and opens that way's own dialog: one dialog after another, never one stacked on the chooser.
  • Give it no footer: ×, Esc and a click on the scrim close it.
  • Title it with the label of the control that opened it (Writing).
  • Use it instead of a DropdownMenu when each way needs a line of explanation to choose between them. When the names alone are enough, a menu stays the choice.
  • When the follow-up dialog closes, focus returns to the control that opened the chooser.
  • On a phone it stays a centered dialog, as a few fixed choices with no typing do (On a phone). A follow-up dialog that is a sheet on a phone opens with ×, not Back: the chooser is closed, so it isn't an earlier step of the same flow.

Cancel comes first and the commit button last, both at the end of the footer, so the commit button is where the eye ends: bottom right. The start of the footer holds at most one quiet item, never both: a muted TextLink that leads elsewhere, or a DialogFooterNote that says what the commit will do. Either one is safe to miss, because people don't look there first.

dialog/compositions/footer-note
dialog/compositions/footer-link

A dialog that is only read has one button, which closes it. It is still pink, so the dialog keeps one obvious way forward.

dialog/compositions/footer-close-only

The footer stays one row on a phone, the same as on a desktop (stdrc, 2026-10-22). One layout everywhere means Cancel and the commit button are in the same place on every screen; stacking is only a fallback for a label too long for the row. So the footer stacks when its buttons don't fit on one line, at any width, and never because the window is narrow:

  • The buttons stack full width, the commit button on top and Cancel under it. Cancel takes the ink border of default there, with its hover and press: a frameless button stretched to the full width reads as a line of text, not a button, so once buttons stack each needs its own box (stdrc, 2026-10-22). Keep writing Cancel as ghost; the stack gives it the frame, and it goes back to frameless when the row fits again.
  • A note or a link stays first, left-aligned above the buttons.
  • Write the parts in the order of the row: the note or the link first, then Cancel, then the commit button. The footer turns the stack around on screen only: Tab still goes Cancel then commit, so in the stack focus moves up from Cancel to the commit button (Accessibility).

Use a note only in a size="lg" or size="wide" dialog, and keep it to 40 characters. Put DialogFooterNote directly in DialogFooter, before the buttons: the footer then holds the buttons as one group. On a desktop the note is one line and never wraps, and it is never cut. It sits beside the buttons when both fit on the line; when they don't, it goes above them and the buttons stay one row at the end, so they never leave the footer's padding. A link at the start does the same. A smaller dialog has no room for a note beside its buttons: a development build warns when a note is in a sm or md dialog, the default included, unless a className sets the dialog's width instead (one of the exceptions in Variants). On a phone, above the buttons, the note has the footer's full width and may wrap to 2 lines. Anything longer belongs in the body.

When the dialog is a sheet on a phone (On a phone), it has no footer, so the note, or a link written first, moves to the end of the body. The note keeps the same muted footnote text, left-aligned, at most 2 lines; the sheet's commit button in its head does what the note describes. The link becomes a full-width outline button there (The sheet).

Behavior

  • A centered dialog appears and disappears without animation, always over the scrim (Motion). On a phone a dialog with fields is a sheet that slides up instead (On a phone).
  • It opens the same however it was mounted: opened after it mounted, or mounted already open (open or defaultOpen, a lazy or conditional mount, a fresh key), so a phone sheet mounted open slides up too. Base UI plays the enter only when open turns true after the root mounted, so Dialog mounts closed and opens one commit later, before the first paint, as Drawer, AlertDialog and Lightbox do. They all wait the same commit, so surfaces mounted open together still stack in their order (#proj-frontend:#121).
  • Esc, × and Cancel close a dialog. A click on the scrim closes a small dialog, except one drawn as a sheet on a phone (On a phone).
  • Esc closes only the topmost thing that is open. A Menu or a Select opened from the dialog closes on Esc and the dialog stays open; the next Esc closes the dialog. In a widget of your own that closes on Esc, such as a suggestion list in a text box, call event.stopPropagation() in its onKeyDown, not only preventDefault(): Base UI closes the dialog on every Esc that reaches it, prevented or not. When you can't change the widget, cancel the close in onOpenChange on Dialog when details.reason is "escape-key" and details.event.defaultPrevented is true.
  • Don't close a large form dialog on a click outside it: pass disablePointerDismissal on Dialog, so a half-filled form isn't lost to a stray click.
  • A centered dialog on a narrow screen keeps a 16px margin on each side and never grows taller than the window less 32px.
  • On a desktop and a tablet, a dialog with placement="top" sits near the top of the window instead of the middle (At the top).
  • On a phone a centered dialog moves up while the on-screen keyboard is open, and goes back to the middle when it closes (On a phone).
  • Below 768px the wide dialog hides DialogNav and the sections follow one another.
  • DialogFooter keeps its buttons in one row at every width. It measures the row laid out as a row, and only when its children run past the footer does it set data-stacked and stack them full width, the commit button on top (The footer). Content that may shrink, such as a label that truncates or wraps, shrinks first, so only what can't, the buttons, makes the footer stack. It measures again when the dialog resizes, a label changes or a font loads, and not at all while the footer is hidden in a sheet. A button wrapped in another element, such as a tooltip's trigger, fills the width too. AlertDialogFooter does the same.
  • A footer that sets its own layout with className, such as a checkbox beside the button or a pair of links, is measured the same way and needs nothing more: it keeps that layout while its content fits on one line, and stacks only when it doesn't. Give text that may give way min-w-0 (and truncate to cut it), so it shrinks before the footer stacks.
  • A dialog opened from a dialog or a sheet draws its own, lighter scrim over the one below (Stacked overlays). Render it inside the first one and this happens by itself. layer={1} is only for a dialog rendered outside the first one's tree: it lifts the dialog and its scrim above the first. What is lifted is the dialog's portal, to z-dialog-layer as a stacking context of its own, so a Select list or a menu opened from the card, which Base UI portals into the same element, is drawn over the card; the scrim follows the card, so a layer in overlay is ignored there. Before, the card and the scrim were lifted and the list stayed at z-popup, under both, and an app had to portal each list into the dialog's body.
  • A Select list, a menu or a popover opened from a dialog is portaled beside its card, inside the dialog, so it is drawn over the card and its head, and focus and a press on it stay inside the dialog. Don't pass it a container inside the dialog's scrolling body to get that: a ScrollArea is a stacking context of its own, so a list portaled into one is drawn under the head whenever it reaches it (ScrollArea). In a phone sheet the list also stays under the head (Popups in a sheet).
  • An app's own modal (its own backdrop, Esc and focus, on DialogSurface) joins the same stack with OverlayLayerProvider and useParentOverlayKind from @botiverse/raft-ui/wip (Stacked overlays).

At the top

On a desktop and a tablet, a dialog that grows out of something near the top of the window takes placement="top", so it opens where people were looking. Search is the case today: the panel's top edge covers the top bar's field, so the field seems to grow into it (Search). Centered, it would open somewhere else, and on a tall window far from the field.

  • The dialog stays centered across. Its top edge sits at --dialog-top, 8% of the window's height down when nothing sets it.
  • It never grows past the window's bottom less 16px, so it ends on screen however low its top is; its body scrolls instead. Its width still comes from size.
  • To put the top edge on something, the app measures that thing as the dialog opens and sets --dialog-top in the style of DialogContent. raft-ui measures nothing and knows nothing of what the dialog is anchored to.
  • Below 768px it does nothing: the dialog sits in the middle like every other, and --dialog-top is ignored. Like every centered dialog there, it moves up only while the on-screen keyboard is open (On a phone).
  • DialogSheetContent takes it too, on a desktop and a tablet. On a phone a sheet is docked to the bottom and ignores it.
dialog/compositions/top-placement

Scrolling in a ScrollArea

DialogBody scrolls natively, so on Windows, and on a Mac set to always show scrollbars, a long body draws the platform's scrollbar, which takes room from the body's width when it appears. With unstable_scrollArea the body is a ScrollArea instead: it scrolls the same way and draws raft-ui's scrollbar, which takes no room and looks the same on every platform and in both themes.

dialog/compositions/create-agent
  • It is opt-in for now and becomes the default in a later minor release. Nothing else about the body changes, so when it is the default, delete the prop.
  • Use it for a body that can grow past the window: a form of many fields, a long list, a long text. A body that never scrolls draws no scrollbar either way.
  • The body scrolls sideways too when something in it is wider than it (a wide table, a line that doesn't wrap, a <pre>, an image), as the native body does: the dialog keeps its width, and a horizontal scrollbar shows along the body's bottom edge, over the footer. A body with nothing wider than itself scrolls down only and draws no horizontal scrollbar. Sideways, the whole body moves, its fields with the wide part, so for a wide table prefer TableScroll (Table) around it: then only the table scrolls. In a body laid out as a grid (className="grid gap-4") one wide child also makes every row as wide as itself, with or without the prop, since the grid's one column takes the width of its widest item; a TableScroll around the wide child, or grid-cols-[minmax(0,1fr)] on the body, keeps the rows the body's width.
  • The body is still the element with data-slot="dialog-body". It takes className, ref, the native props and the children as before, so a layout written on it (className="grid gap-4") is unchanged, and nothing is put inside it beside its children. It uses ScrollArea's absolute gutters: a frame, data-slot="dialog-body-frame", is rendered around the body and holds the scrollbar.
  • The frame, not the body, is the child of DialogContent. A class that sizes the body in the dialog (max-h-*, h-*, flex-*) goes in wrapperClassName, which is the frame's; padding and layout stay in className. A selector of your own that reaches the body as a child of the content ([data-slot=dialog-content] > [data-slot=dialog-body]) no longer matches: select the frame, or the body as a descendant.
  • The body is a Tab stop only while it overflows and holds nothing that takes focus, as a native scroller is. A form adds no stop: Tab goes from the head to the first field, and the keyboard scrolls the body from whatever inside it has focus. A long text that is only read can be reached with Tab and scrolled with the arrow keys. A tabIndex of your own wins.
  • A scroll that reaches the body's end stops there, and a Mac trackpad or iOS still bounces the body (overscroll="contain", as in a Panel).
  • For a header or a footer stuck inside the body (position: sticky), keep the scrollbar clear of it from the frame: wrapperClassName="[--r-scroll-area-rail-inset-bottom:56px]" (Edge state).
  • The frame is a stacking context of its own, as every ScrollArea is: a popup given a container inside the body is drawn under the dialog's head. Leave popups where raft-ui portals them, beside the card.
  • In a phone sheet (On a phone) it is the same body: it scrolls under the head on the 16px margin, keeps the home indicator's inset, and holds the footer's note or link at its end.
  • A bar body ignores it. On a desktop a bar body doesn't scroll: the sections inside it do, and its DialogNav is a ScrollArea already. In a phone sheet a bar body still scrolls natively.

On a phone

Below 768px a dialog stays centered unless it has several fields, a long list or steps, in which case it becomes a sheet (stdrc and Artea, 2026-10-21). On a desktop and a tablet every dialog stays centered.

A dialog that stays centered keeps its footer in one row, as on a desktop. It stacks only when the buttons don't fit, the commit button on top (The footer).

What the dialog holdsOn a phone
A decision: a statement and buttons, at most a few fixed choices, nothing typed (every confirmation; archive, stop, reset)The centered dialog, as on a desktop
One input or one text box and its buttons: a confirmation that asks for a typed name, naming a section, editing a display name or a description, a reason to rejectThe centered dialog, as on a desktop. While the keyboard is open it moves up, so the keyboard doesn't cover the field or the buttons (The keyboard)
Several fields, a long or searchable list to pick from, or steps: forms, pickers, wizardsA sheet as tall as its content, at most 90% of the screen
Content that is only read: role help, release notes, an app's details. It is short information, so it stays a dialogThe centered dialog, as on a desktop

The sheet

  • Rises from the bottom over the scrim, with radius-dialog on its top corners. The strip of page left above it shows that it is a layer over the page, not a new page.
  • Is as tall as its content, and at most 90% of the screen; a longer body scrolls inside it (artin, 2026-11-27, #proj-mobile:c2a6f94a). A sheet that was always 90% tall left the lower half of the screen empty under a step with one field. Neither platform opens every sheet at full height: Apple's guidelines say "In an iPhone app, consider supporting the medium detent to allow progressive disclosure" (Sheets), and Material's say a bottom sheet's first height "is capped at 50% of the screen height" (Bottom sheets). 90% stays the cap, so the strip of page above the tallest sheet is always there.
  • When its content changes height, such as the next step of a flow or a text box that grows as people type, the sheet moves to the new height over 200ms with ease-slide, growing or shrinking from its top edge, so a new step doesn't jump (Motion). With reduced motion it changes at once. A change of the window or the keyboard isn't animated: only the content's.
  • Its head is a pushed page's head (Navigation): × at the start, the title, and the dialog's one commit button at the end, at size md with the same color and words as on a desktop. It has no footer: × is Cancel. In a flow of steps the button at the end is the step's (Next, then the last step's action).
  • From the second step of a flow on, Back takes the place of × at the start of the head, with no × beside it (stdrc, 2026-10-22): the sheet is a stack of steps, and Back undoes one, as on a pushed page. Esc still closes the sheet from any step; on a touch screen, people go Back to the first step and close it with ×.
  • A footer note moves to the end of the body, in muted footnote text, left-aligned (The footer).
  • A link written first in the footer moves to the end of the body as a full-width outline button (Button, variant="default"), 32px tall with a 44px hit area, as the commit button in the head (artin, 2026-11-27, #proj-mobile:c2a6f94a). There it is the only thing a finger must hit, which a TextLink can't be (TextLink): it has no box, and on a touch screen no hover underline, so it read as plain text. It keeps its words and what it does, a real link included.
  • The body scrolls under the head and keeps the phone's 16px margin and the home indicator's inset at the bottom.
  • × and Esc close it. A tap on the scrim doesn't, so a half-filled form isn't lost to a stray tap, as with a large form dialog on a desktop. When something has been typed, ask before closing (Asking before closing).
  • Dragging the sheet down to close it is planned, for when the sheet moves onto Drawer's drag.
  • It slides up as it opens, like every bottom sheet, and its scrim fades in with it (Motion). With reduced motion it is simply there.
  • With the on-screen keyboard up, the sheet sits on the keyboard and is at most the space above it, so the head and its commit button stay in view. A sheet shorter than that keeps its height.
  • An alert or a warning or destructive Banner that appears in the body after it opens, such as the error a failed commit adds, is scrolled into view: the button that caused it is at the top.

The keyboard

Every centered dialog on a phone moves up while the on-screen keyboard is open, whatever its placement, and no app opts in. A centered dialog covered by the keyboard is always wrong: the field people are typing in, or the buttons under it, are out of sight. So this is the platform's behavior, not a choice per dialog (stdrc, 2026-10-21: centered unless the keyboard is open).

  • Its top edge goes where the phone's top bar ends: --header-height below the top of what is visible, under the status bar.
  • It ends at least 16px above the keyboard. When it is taller than that, its body scrolls.
  • When the keyboard closes, it goes back to the middle.
  • The keyboard counts as open only while a text field has focus and the visible area is more than 100px shorter than the window, so a short window with nothing to type in doesn't move it.
  • A sheet doesn't move: it shrinks to the space above the keyboard instead.

Popups in a sheet

A Select or Combobox list, a menu or a popover opened from a field in a sheet stays in the sheet, under its head: it flips to the other side of its field and shrinks to the room between the head and the bottom of what is visible of the sheet, and its rows scroll. Nothing is passed for this: every raft-ui popup with no collisionBoundary of its own takes the sheet's, decided for that popup each time it is placed.

  • Why: a popup otherwise keeps to the window. With the keyboard up the sheet is all that is left of the screen, and a list that flipped upward covered the head, the title and the commit button with it, and ran past the sheet's top edge.
  • The room ends at the sheet's bottom edge, or at the top of the on-screen keyboard when that is higher (the visual viewport's bottom): what counts is what can be seen.
  • A popup anchored in the head is left alone: a tooltip, a menu or a popover on a head button opens where it asks to, a tooltip above the button and over the scrim, as outside a sheet. Held under the head it would be pushed down over the sheet's content.
  • A popup anchored in the sheet's body is always bounded, however little room its field has: the list takes the larger side, above or below the field, is as tall as that side less 12px (4px from the field, 8px from the edge of the area), and its rows scroll. Why: on a small phone with the keyboard up, a field in the middle of a sheet has about 130px on each side, and that is the commonest case, not a rare one. A list let over the head there covers the title and the commit button, or, portaled into the sheet's scrolling body, is drawn under the head, where its first rows can be neither seen nor pressed. A short list that scrolls can be used; one hidden under the head can't. No popup sets a least height, so with 60px on the larger side a list is 48px tall, about one row.
  • It is drawn over the sheet's content, as from any dialog (Behavior).
  • A dialog, an alert dialog, a drawer or a lightbox opened from the sheet starts again: its popups keep to the window, or to its own sheet. So does an app's own surface inside OverlayLayerProvider.
  • A centered dialog bounds nothing: a list opened from a small card may run past the card's edge, over the scrim, as it always has.
  • To opt one popup out, pass it collisionBoundary="clipping-ancestors", Base UI's default, and it keeps to the window. Any collisionBoundary you pass wins; leaving it out, or passing undefined, takes the sheet's.
  • A sheet you draw yourself, with its own surface, a head that stays put and a body that scrolls, gets the same from SheetPopupBoundary (@botiverse/raft-ui/wip): wrap the body in it, or the head and the body, and give it the head's ref as head. The sheet's bottom edge is the head's parent's, or surface's when the head is nested deeper. It renders no element. When the sheet is also an OverlayLayerProvider, put SheetPopupBoundary inside it.
  • Which element a popup is anchored to is read from the page: the open trigger whose aria-controls names the popup's list or panel, and for a tooltip or a preview card, which nothing names, the one open trigger of its kind. A popup whose anchor can't be told, such as a context menu at the pointer, stays bounded.
  • Two tooltips open at once, or two preview cards, can't be told apart in a sheet you draw yourself, where a head button's tooltip is under SheetPopupBoundary when it wraps the head: nothing names either, so both stay bounded, and one anchored in the head can flip downward, over the sheet's content. In DialogSheetContent and Drawer the head starts outside the sheet, so its tooltips are never bounded. Wrap only the body, or pass the tooltip its anchor.
  • A popup given an anchor is decided by it, and nothing is looked up in the page: an element, a ref, or a function that returns one is in the head or isn't, like a trigger. A virtual element (an object with getBoundingClientRect, such as a text selection) has no element to find in the head, so it is in the head when the middle of its rect is. An anchor that is empty when the popup is placed, a ref not yet set, falls back to the trigger.
  • In Safari on iOS the page pans under the keyboard, and the boundary is moved by the visual viewport's offset so it stays on the head: twice for a popup fixed to the window, once for one with positionMethod="absolute" or portaled into a transformed element such as a drawer (@floating-ui/dom 1.8 takes that offset from a boundary rect, and adds it to the field only for a popup fixed to the window). A rect you pass as collisionBoundary yourself is not corrected.

Making a dialog a sheet

Write the dialog as it is on a desktop and swap DialogContent for DialogSheetContent, and the commit Button for DialogCommit. Nothing else changes, and on a desktop nothing changes at all. Below 768px:

  • DialogHeader becomes the pushed page's head: its DialogClose goes first, as the head's ×, and its DialogTitle follows. Give the header a DialogClose as a direct child: it is the only way out of the sheet. One wrapped in a Tooltip, a Fragment or a component of your own isn't found and stays after the title; in development the head warns about it in the console.
  • The head has room for one line, the title. A DialogDescription goes at the top of DialogBody in a sheet dialog, not in DialogHeader.
  • DialogCommit moves to the end of the head at size="md", with the same variant, words, disabled and loading state. A type="submit" button stays its form's default button: it is tied to the form it was written in by the form's id, so a click and Enter in a field still submit, and neither does while it is disabled. Give that form an id (or pass form to DialogCommit); without one a click still submits but Enter in a field doesn't, and only on a phone, so in development DialogCommit warns about it in the console, as it does when a submit DialogCommit has no form to submit.
  • DialogFooter is hidden, and with it Cancel and any other button in it, such as a step's Back. A DialogFooterNote moves to the end of DialogBody instead, left-aligned in muted footnote text; keep the note to 40 characters, so it is at most 2 lines there. A TextLink written first in the footer, as its direct child and not inside a Fragment, moves there as a full-width Button with variant="default" and size="md". It keeps the link's children, render (such as <a href>) and handlers, and drops its variant and className, which were for text. Nothing is passed for this.
  • DialogBody scrolls under the head on the phone's 16px margin, with the home indicator's inset at the bottom. A wide dialog's bar body does the same: its DialogNav is hidden and its sections follow one another.
  • The sheet takes its height from the content, so nothing in the body needs a height for the sheet. A part that fills what it is given, such as a ChoiceList with fill in a body laid out as a flex column, is as tall as its rows, and scrolls inside the sheet once the sheet reaches 90%. Don't give the body or a child a height in vh or dvh to fill the sheet: it would make every sheet that tall again.
dialog/compositions/sheet-form

In a flow of steps, write each step's button as a DialogCommit: Next, then the last step's action. From the second step on, put a DialogSheetBack in DialogHeader: on a phone the head shows it at its start and leaves out the DialogClose, so a later step has Back and no ×; on a desktop it draws nothing and Back stays in the footer.

In the example below, the first step has one field, so on a phone the sheet is short, and Next grows it to the second step's content. The first step's footer starts with a link, which on a phone ends the body as a full-width outline button.

dialog/compositions/sheet-steps

A dialog or an alert dialog opened from the sheet is centered over it, on its own lighter scrim (Stacked overlays). It keeps its own head, footer and commit button: only the sheet's own parts change.

Asking before closing

When something has been typed, × and Esc ask first. Cancel the close in onOpenChange on Dialog and open the confirm from inside the sheet:

tsx
<Dialog
  open={open}
  onOpenChange={(next, details) => {
    if (!next && dirty) {
      details.cancel();
      setConfirmOpen(true);
      return;
    }
    setOpen(next);
  }}
>

The example below is wired that way; its canvas shows the confirm after × with edits.

dialog/compositions/sheet-stacked

A dialog that stays centered on a phone keeps DialogContent and Button.

Content

  • Title the dialog with the words of the button that opened it, or Edit and the item's name. A confirmation that only asks whether to go on, with nothing to fill in or choose, adds a question mark (Delete box?); a dialog with something to fill in or choose doesn't (Delete server) (Writing). Label its main button with the action it performs, without the object: usually the title's verb (Create channel → Create); an Edit title's button is Save, and the other one Cancel (Writing).
  • Set body text in foreground, as the title is; only a HelperText in DialogDescription or DialogFooterNote is foreground-muted. Their type styles are in Typography.

Accessibility

  • Dialog wraps the Base UI Dialog. It provides the dialog role, the focus trap, Esc and focus return to the trigger.
  • Give every dialog a DialogTitle. It becomes the dialog's accessible name, and it is what a screen reader announces on open.
  • DialogDescription becomes the dialog's description.
  • The focus order and the reading order are the markup's: the note or the link, Cancel, then the commit button. In the row that is the order seen. When the buttons stack, the commit button is drawn on top but stays after Cancel in the markup, so focus goes up from Cancel to it, as it would in any browser. The footer doesn't use reading-flow to follow the stack: the dialog's focus trap wraps in markup order, and a visual order fights it, trapping Tab on Cancel and leaving the commit button unreachable (Jasper, 2026-10-22).
  • To have the note read with the commit button, give the note an id and the button aria-describedby.
  • The × of DialogClose is labeled "Close". Pass aria-label to change it.
  • In a sheet the head puts × (or Back) first in the DOM, so Tab and a screen reader meet the head in the order it is seen: ×, the title, the commit button. The title stays the dialog's accessible name.
  • DialogSurface has no behavior of its own. The app that uses it must add the dialog role, aria-modal, a name, the focus trap, Esc and the scrim.

Rules

  • Put at most two buttons in the footer: Cancel first (variant="ghost"), the confirm button last. They stay one row on a phone; only when they don't fit do they stack, the confirm button on top and Cancel framed.
  • The one exception is the prompt on closing or leaving with unsaved changes that can be saved straight from the prompt. It may have three buttons: Keep editing (variant="ghost", first), Discard changes, then Save (variant="primary", last). With two, someone who wants to save has to keep editing, find Save and close again, and saving and leaving is what most people want there; the channel details do this (Jasper, 2026-11-14). A prompt that can't save directly keeps two buttons. It isn't a general rule: three buttons stack into three rows on a phone, and one exception shouldn't invite a secondary button in every dialog. The color of Discard changes is still open (Open questions).
  • Put at most one item at the start of the footer: a muted TextLink or a DialogFooterNote, never both. Never put an action that changes something there, and never something people need to decide; that goes in the body.
  • Use a DialogFooterNote only in a size="lg" or size="wide" dialog, and keep it to 40 characters: it never wraps on a desktop.
  • Build the footer from DialogFooter, not a row of your own: it holds the spacing, the order and the stack when the buttons don't fit.
  • Make the confirm button pink (variant="primary") when it does something. Color it by its consequence when it interrupts or can't be undone (AlertDialog).
  • Put anything people must read before they act in a Banner inside the body (Feedback).
  • Pad every size by 20px. Its width comes from size (Variants), never from a class of your own, except the exceptions listed there.
  • Don't pass overlay={false} in product code: every centered dialog has the scrim, without exception.

API

Dialog

PropTypeDefault
actionsRefA ref to imperative actions. - `unmount`: Ends the closing phase of the dialog after an externally controlled closing animation finishes. Call `preventUnmountOnClose()` in `onOpenChange` first, otherwise the dialog completes closing on its own. Whether it leaves the DOM is decided by `keepMounted` on the portal. - `close`: Closes the dialog imperatively when called.RefObject<DialogRootActions | null>
childrenThe content of the dialog. This can be a regular React node or a render function that receives the `payload` of the active trigger.ReactNode | PayloadChildRenderFunction<unknown>
defaultOpenWhether the dialog is initially open.booleanfalse
defaultTriggerIdID of the trigger that the dialog is associated with. This is useful in conjunction with the `defaultOpen` prop to create an initially open dialog.string
disablePointerDismissalWhether to prevent the dialog from closing on outside presses. For non-modal dialogs, this also prevents the dialog from closing when focus moves outside of it.booleanfalse
handleA handle to associate the dialog with a trigger. If specified, allows external triggers to control the dialog's open state. Can be created with the Dialog.createHandle() method.BaseDialog.Handle<unknown>
modalDetermines if the dialog enters a modal state when open. - `true`: user interaction is limited to just the dialog: focus is trapped, document page scroll is locked, and pointer interactions on outside elements are disabled. - `false`: user interaction with the rest of the document is allowed. - `'trap-focus'`: focus is trapped inside the dialog, but document page scroll is not locked and pointer interactions outside of it remain enabled.boolean | "trap-focus"true
onOpenChangeEvent handler called when the dialog is opened or closed.(open: boolean, eventDetails: BaseDialog.Root.ChangeEventDetails) => void
onOpenChangeCompleteEvent handler called after any animations complete when the dialog is opened or closed.(open: boolean) => void
openWhether the dialog is currently open.boolean
triggerIdID of the trigger that the dialog is associated with. This is useful in conjunction with the `open` prop to create a controlled dialog. There's no need to specify this prop when the dialog is uncontrolled (that is, when the `open` prop is not set).string

DialogBody

PropTypeDefault
barA pinned bar of a scrolling (`size="wide"`) dialog.booleanfalse
unstable_scrollAreaScroll the body in a ScrollArea, with raft-ui's scrollbar in place of the platform's. A frame (`data-slot="dialog-body-frame"`) is rendered around the body and holds the scrollbars; the body keeps its slot, `className`, `ref`, native props and children, so a layout written on it (`grid gap-4`) is unchanged. It becomes the default in a later minor release: delete the prop then. A `bar` body ignores it.booleanfalse
wrapperClassNameWith `unstable_scrollArea`, the class of the frame around the body: the classes that size the body in the dialog (`max-h-*`, `h-*`, `flex-*`) go here, not in `className`. Ignored without `unstable_scrollArea`.string

Also takes the attributes of its element.

DialogClose

PropTypeDefault
childrenReactNode
size`md` (32px) and `icon-md` for rows, cards, banners, toolbars and panel headers; `lg` and `icon-lg` (the control height) for dialog footers, forms and beside a field; `xl` for a full-width call to action; `icon-sm` (28px, a 44px hit area) for an icon-only action on a line of a row or a card, such as a comment header's More, never in a toolbar. The size follows the place: see Button › Size by place."md" | "lg" | "xl" | "icon-sm" | "icon-md" | "icon-lg" | DeprecatedButtonSize"md"
variant"primary" | "accent" | "warning" | "danger" | "default" | "outline" | "information" | "muted" | "success" | "danger-secondary" | "danger-outline" | "ghost" | "on-frame"
nativeButtonWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`).booleantrue
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

DialogCommit

The dialog's one commit button: a `Button`, written where it goes on a desktop (the end of `DialogFooter`). In a `DialogSheetContent` below 768px it is drawn at the end of the sheet's head instead, the same button (color, words, disabled and loading state) at `size="md"`. In a flow of steps, write each step's button as one (Next, then the last step's action).
PropTypeDefault
loadingBusy: shows the spinner and blocks activation (click, Enter, Space and form submission) while keeping the button focusable. A busy button is `aria-disabled`, not natively `disabled`, so the focus a press left on it stays there and is still there when the wait ends.boolean
loadingLabelThe spinner's accessible name while `loading`: say what is happening.string
size`md` (32px) and `icon-md` for rows, cards, banners, toolbars and panel headers; `lg` and `icon-lg` (the control height) for dialog footers, forms and beside a field; `xl` for a full-width call to action; `icon-sm` (28px, a 44px hit area) for an icon-only action on a line of a row or a card, such as a comment header's More, never in a toolbar. The size follows the place: see Button › Size by place."md" | "lg" | "xl" | "icon-sm" | "icon-md" | "icon-lg" | DeprecatedButtonSize"md"
variant"primary" | "accent" | "warning" | "danger" | "default" | "outline" | "information" | "muted" | "success" | "danger-secondary" | "danger-outline" | "ghost" | "on-frame"
focusableWhenDisabledWhether the button should be focusable when disabled.booleanfalse
nativeButtonWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`).booleantrue
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

DialogContent

PropTypeDefault
layer0 | 1
overlayfalse | DialogOverlayProps
placementWhere the card sits in the window. `"center"` (the default): in the middle. `"top"`: centred across, its top edge at `var(--dialog-top, 8vh)`, and never taller than the window less that top and 16px, so it never runs past the window's bottom; its width is still `size`'s. To anchor the card to something on the page (search under the top bar's field), measure it and set `--dialog-top` in `style`. Desktop and tablet only: below 768px every centred dialog sits in the middle and moves up only while the on-screen keyboard is open (dialog.md, "On a phone")."center" | "top"
portalPropsAlertDialogPortalProps
size"sm" | "md" | "lg" | "wide""md"
finalFocusDetermines the element to focus when the dialog is closed.boolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | HTMLElement | null | void)
initialFocusDetermines the element to focus when the dialog is opened. By default, focus moves to the first tabbable element inside the popup, except when the dialog is opened by touch — then the popup itself is focused to avoid opening the virtual keyboard.boolean | RefObject<HTMLElement | null> | ((openType: InteractionType) => boolean | HTMLElement | null | void)
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

DialogDescription

PropTypeDefault
children (required)HelperText
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

DialogFooter, DialogHeader

PropTypeDefault
barA pinned bar of a scrolling (`size="wide"`) dialog.booleanfalse

Also takes the attributes of its element.

DialogNav

The section list of a wide (`size="wide"`) dialog, inside a `bar` body: a `<nav>` that is a ScrollArea, its rows in the area's content element.
PropTypeDefault
actionsRefMethods to scroll from code that the container doesn't have natively.((instance: ScrollAreaActions | null) => void | (() => void | { [UNDEFINED_VOID_ONLY]: never; }) | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | RefObject<ScrollAreaActions | null>
childrenThe scrolling content, in ScrollArea's own container.ReactNode
contentRefAn element whose size is the content's, watched for size changes (such as a hidden mirror of a textarea's text). Without it each element child of the container is watched, and children added or removed.RefObject<HTMLElement | null>
contentStyleStyle of the content element; renders it, as `contentClassName` does.CSSProperties
fadeFade the content out toward an edge that has more past it. The scrollbars don't fade.boolean
hideDelayHow long the scrollbars stay after scrolling stops, in ms. At least 100 with `trigger="scroll"`.number
onEdgeChangeCalled when the area reaches or leaves an edge, and after mounting when the content overflows.(edges: ScrollAreaEdges) => void
onScrollThe container's scroll events.UIEventHandler<HTMLDivElement>
orientationThe directions the area scrolls in. Content too wide for a vertical area is cut off.ScrollAreaOrientation
overscrollWhat a scroll that reaches the end does: stop there with no bounce (`none`, the default), stop there but let Mac trackpads and iOS bounce the area (`contain`), or carry on to the page behind (`auto`, which leaves the container's own `overscroll-behavior` alone). Only in the directions the area overflows right now.ScrollAreaOverscroll
railInsetRoom in px the scrollbars keep clear at each end, such as a sticky header's height, so they don't run over it. Also settable in CSS, on the root: `--r-scroll-area-rail-inset-{top,bottom,left,right}`, which don't inherit.ScrollAreaRailInset
renderAnother element in place of ScrollArea's own `<div>`, as the container (an element or a function that gets the props). It must hold children: the gutters are its first child.ReactElement | ((props, state) => ReactElement)
sizeThumb thickness: `small` is 5px, `medium` 7px; both grow while pointed at or dragged.ScrollAreaSize"md"
tabIndexThe container's: by default `0` while there is something to scroll.number
triggerWhen the scrollbars show. They always show while scrolling or dragging.ScrollAreaTrigger

Also takes the attributes of its element.

DialogOverlay

PropTypeDefault
layer0 | 1
forceRenderWhether the backdrop is forced to render even when nested.booleanfalse
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

DialogPortal

PropTypeDefault
containerA parent element to render the portal element into.HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null>
keepMountedWhether to keep the portal mounted in the DOM while the popup is hidden.booleanfalse
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

DialogSheetBack

Back, in a later step of a flow drawn as a phone sheet: it takes the head's start in place of × (stdrc, 2026-10-22). The sheet is a stack of steps, and Back undoes one, as on a pushed page; Esc still closes. Put it in `DialogHeader` beside the `DialogClose`, from the second step on; it draws nothing outside a sheet, where Back stays in the footer. Its icon is `arrow-left`, as every Back (Alignment, "The ends of a header").
PropTypeDefault
activateOnTouchEndActivate when the finger lifts instead of on the click after it, so a tap that stops a scrolling page still acts. Give it to Back, the header's navigation; not to actions that change things (design/patterns/navigation.md#switching-on-finger-lift).boolean
focusableWhenDisabledWhether the button should be focusable when disabled.booleanfalse
nativeButtonWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`).booleantrue
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

DialogSheetContent

DialogContent for a dialog with several fields, a long list or steps. On a desktop and a tablet it is DialogContent, the same DOM and classes. Below 768px it is a sheet: docked to the bottom, as tall as its content up to 90% of the screen, sliding up over its scrim; when its content changes height (the next step, a growing text box) the sheet animates to the new height. `DialogHeader` becomes a pushed page's head (× at the start, the title, the `DialogCommit` button at the end), `DialogFooter` is hidden (× is Cancel; a link written first in it becomes a full-width Button at the end of the body) and `DialogBody` scrolls on the phone's 16px margin above the home indicator. Base UI keeps Esc, focus and close. `placement` applies on a desktop and a tablet only: the sheet is docked to the bottom.
PropTypeDefault
layer0 | 1
overlayfalse | DialogOverlayProps
placementWhere the card sits in the window. `"center"` (the default): in the middle. `"top"`: centred across, its top edge at `var(--dialog-top, 8vh)`, and never taller than the window less that top and 16px, so it never runs past the window's bottom; its width is still `size`'s. To anchor the card to something on the page (search under the top bar's field), measure it and set `--dialog-top` in `style`. Desktop and tablet only: below 768px every centred dialog sits in the middle and moves up only while the on-screen keyboard is open (dialog.md, "On a phone")."center" | "top"
portalPropsAlertDialogPortalProps
size"sm" | "md" | "lg" | "wide""md"
finalFocusDetermines the element to focus when the dialog is closed.boolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | HTMLElement | null | void)
initialFocusDetermines the element to focus when the dialog is opened. By default, focus moves to the first tabbable element inside the popup, except when the dialog is opened by touch — then the popup itself is focused to avoid opening the virtual keyboard.boolean | RefObject<HTMLElement | null> | ((openType: InteractionType) => boolean | HTMLElement | null | void)
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

DialogSurface, DialogTitle

The dialog's frame — the popover layer, the dialog radius, the seam ring and the float shadow — for a centred modal whose lifecycle the app owns (its own backdrop, Escape and focus handling). It neither positions nor animates itself: the host centres it, and a centred modal has no motion. DialogContent draws the same frame for a Base UI dialog.
PropTypeDefault
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

DialogTrigger

PropTypeDefault
handleA handle to associate the trigger with a dialog. Can be created with the Dialog.createHandle() method.BaseDialog.Handle<unknown>
idID of the trigger. In addition to being forwarded to the rendered element, it is also used to specify the active trigger for the dialog in controlled mode (with the DialogRoot `triggerId` prop).string
nativeButtonWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`).booleantrue
payloadA payload to pass to the dialog when it is opened.{}
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

DialogFooterNote

ExperimentalOne short line at the start of `DialogFooter` that says what the commit button will do ("You'll be billed $8 per member each month"). Muted footnote text, start-aligned and never cut. Only in a `lg` or `wide` dialog, and at most 40 characters: on a desktop it is one line beside the buttons and never wraps; on a phone it goes above the buttons when they don't fit beside it, and may wrap to 2 lines. In a phone sheet, which has no footer, it moves to the end of the body. Longer copy belongs in the body. A footer holds a note or a `TextLink`, never both.
PropTypeDefault
children (required)HelperText

Also takes the attributes of its element.

AnnouncementDialog

Experimental
PropTypeDefault
actionsRefA ref to imperative actions. - `unmount`: Ends the closing phase of the dialog after an externally controlled closing animation finishes. Call `preventUnmountOnClose()` in `onOpenChange` first, otherwise the dialog completes closing on its own. Whether it leaves the DOM is decided by `keepMounted` on the portal. - `close`: Closes the dialog imperatively when called.RefObject<DialogRootActions | null>
childrenThe content of the dialog. This can be a regular React node or a render function that receives the `payload` of the active trigger.ReactNode | PayloadChildRenderFunction<unknown>
defaultOpenWhether the dialog is initially open.booleanfalse
defaultTriggerIdID of the trigger that the dialog is associated with. This is useful in conjunction with the `defaultOpen` prop to create an initially open dialog.string
disablePointerDismissalWhether to prevent the dialog from closing on outside presses. For non-modal dialogs, this also prevents the dialog from closing when focus moves outside of it.booleanfalse
handleA handle to associate the dialog with a trigger. If specified, allows external triggers to control the dialog's open state. Can be created with the Dialog.createHandle() method.BaseDialog.Handle<unknown>
modalDetermines if the dialog enters a modal state when open. - `true`: user interaction is limited to just the dialog: focus is trapped, document page scroll is locked, and pointer interactions on outside elements are disabled. - `false`: user interaction with the rest of the document is allowed. - `'trap-focus'`: focus is trapped inside the dialog, but document page scroll is not locked and pointer interactions outside of it remain enabled.boolean | "trap-focus"true
onOpenChangeEvent handler called when the dialog is opened or closed.(open: boolean, eventDetails: BaseDialog.Root.ChangeEventDetails) => void
onOpenChangeCompleteEvent handler called after any animations complete when the dialog is opened or closed.(open: boolean) => void
openWhether the dialog is currently open.boolean
triggerIdID of the trigger that the dialog is associated with. This is useful in conjunction with the `open` prop to create a controlled dialog. There's no need to specify this prop when the dialog is uncontrolled (that is, when the `open` prop is not set).string

AnnouncementDialogTrigger

Experimental
PropTypeDefault
handleA handle to associate the trigger with a dialog. Can be created with the Dialog.createHandle() method.BaseDialog.Handle<unknown>
idID of the trigger. In addition to being forwarded to the rendered element, it is also used to specify the active trigger for the dialog in controlled mode (with the DialogRoot `triggerId` prop).string
nativeButtonWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`).booleantrue
payloadA payload to pass to the dialog when it is opened.{}
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

AnnouncementDialogClose

Experimental
PropTypeDefault
childrenReactNode
size`md` (32px) and `icon-md` for rows, cards, banners, toolbars and panel headers; `lg` and `icon-lg` (the control height) for dialog footers, forms and beside a field; `xl` for a full-width call to action; `icon-sm` (28px, a 44px hit area) for an icon-only action on a line of a row or a card, such as a comment header's More, never in a toolbar. The size follows the place: see Button › Size by place."md" | "lg" | "xl" | "icon-sm" | "icon-md" | "icon-lg" | DeprecatedButtonSize"md"
variant"primary" | "accent" | "warning" | "danger" | "default" | "outline" | "information" | "muted" | "success" | "danger-secondary" | "danger-outline" | "ghost" | "on-frame"
nativeButtonWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`).booleantrue
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

Changes

  • 0.107.0 · ChangedA phone sheet fits its content, up to 90% of the screen ([Dialog › The sheet](https://raft-design.botiverse.build/components/dialog/#the-sheet)): below 768px DialogSheetContent is as tall as its content, capped at 90%, and a longer body scrolls inside. When the content changes height (the next step, a growing text box) the sheet animates to the new height over 200ms with ease-slide; with reduced motion it changes at once. With the on-screen keyboard up, the sheet sits on the keyboard and is at most the space above it; a short sheet keeps its height.
  • 0.107.0 · ChangedA footer link in a phone sheet is a full-width outline button ([Dialog › The sheet](https://raft-design.botiverse.build/components/dialog/#the-sheet)): a TextLink written first in DialogFooter moves to the end of the sheet's body as Button variant="default" size="md", full width (32px tall, 44px hit area), instead of muted footnote text.
  • 0.105.1 · FixedPanel, PanelHeader, PanelFooter: inside a sheet (DrawerContent, or DialogSheetContent on a phone) they paint the sheet's layer-popover instead of their column's layer-canvas, so the sheet is one surface from the grab handle down; PanelHeader keeps its line-seam. ConversationPanelRoot, ConversationPanelFooter, ThreadPanelRoot and ThreadPanelFooter keep layer-canvas in a sheet, so a conversation or a thread in a sheet changes only in its head (PanelHeader, ThreadPanelHeader). Beside the page they are unchanged.
  • 0.103.0 · Breaking ChangesExplanation slots take only a HelperText: FieldDescription, FormSection's description, a ChoiceList item's description, SelectItemDescription, DialogDescription, AlertDialogDescription, DrawerDescription, PopoverDescription, EmptyStateDescription, CardDescription, CardFooter, BannerDescription, DialogFooterNote (work in progress), MessageActionCardHint, MessageActionCardHeaderDescription, MessageActionCardScopeDescription and MessageActionCardActionsNote. A HelperText is made only by helperText(content, { why, about }): content is any ReactNode (a string, a formatted message, a TextLink inside a sentence), why is "consequence", "audience" or "recovery", and about names the thing the line is about. Each slot renders the content with data-why and data-about, and in development warns once when it is given anything else, which it still renders. ToastDescription, NotificationCenterItemBody, EmptyStateTitle, ListRowDescription and the status and data parts are unchanged.
  • 0.103.0 · ChangedDialogBody and AlertDialogBody draw their text in foreground, not foreground-muted.
  • 0.99.0 · FixedWith unstable_scrollArea, DialogBody and a side drawer's DrawerBody scroll sideways to what is wider than they are ([Dialog › Scrolling in a ScrollArea](https://raft-design.botiverse.build/components/dialog/#scrolling-in-a-scrollarea), [Drawer › Scrolling in a ScrollArea](https://raft-design.botiverse.build/components/drawer/#scrolling-in-a-scrollarea)). The body is now a ScrollArea in both directions (orientation="both"): a child wider than the body (a wide table, a line that doesn't wrap, a <pre>, an image) is reached with a sideways wheel, a trackpad, a finger or the arrow keys, under a horizontal scrollbar along the body's bottom edge, over the footer. Where the two scrollbars meet each stops short of the corner.
  • 0.98.0 · AddedA side drawer's DrawerBody can scroll in a ScrollArea, with raft-ui's scrollbar in place of the platform's ([Drawer › Scrolling in a ScrollArea](https://raft-design.botiverse.build/components/drawer/#scrolling-in-a-scrollarea)). In a drawer from the right or the left, <DrawerBody unstable_scrollArea> renders a frame (data-slot="drawer-body-frame") around the body and binds the body as a ScrollArea with absolute gutters, as DialogBody does with the same prop. The body keeps data-slot="drawer-body", className, ref, the native props, render and its children, and is still the flex column they are laid out in, so a layout written on it (className="gap-4") is unchanged and its padding still scrolls with the content; wrapperClassName is the frame's class, for the classes that size the body in the drawer (max-h-*, h-*, flex-*). The body is a Tab stop only while it overflows and holds nothing that takes focus (a tabIndex of your own wins), so a form gains no stop and a long text that is only read can be scrolled with the keyboard, and a scroll stops at its end (overscroll="contain"). A bottom or top sheet ignores both props and renders the body as before.
  • 0.97.0 · AddedDialogBody can scroll in a ScrollArea, with raft-ui's scrollbar in place of the platform's ([Dialog › Scrolling in a ScrollArea](https://raft-design.botiverse.build/components/dialog/#scrolling-in-a-scrollarea)). <DialogBody unstable_scrollArea> renders a frame (data-slot="dialog-body-frame") around the body and binds the body as a ScrollArea with absolute gutters. The body keeps data-slot="dialog-body", className, ref, the native props and its children, so a layout written on it (className="grid gap-4") is unchanged; wrapperClassName is the frame's class, for the classes that size the body in the dialog (max-h-*, h-*, flex-*). The body is a Tab stop only while it overflows and holds nothing that takes focus (a tabIndex of your own wins), so a form gains no stop and a long text that is only read can be scrolled with the keyboard, and a scroll stops at its end with the bounce kept (overscroll="contain"). It works the same in DialogSheetContent below 768px. A bar body ignores the prop.