Choose an overlay for the task
Choose an overlay by how much context and interruption the task needs.
How much should this interrupt the current task?
Use the smallest overlay that gives the user enough room and context. A tooltip explains a nearby control; a popover presents related lightweight content; a menu offers commands or choices; a dialog asks for focused attention; a drawer gives a larger surface while retaining page context.
| Need | Start with | Tradeoff |
|---|---|---|
| Explain an icon or unfamiliar term | Tooltip | Keep it brief; it is not a place for essential instructions. |
| Show a compact editor or related details | Popover | The page remains visible, but space is constrained. |
| Offer actions at a trigger | Dropdown Menu or Context Menu | Use menu semantics for commands, not general forms. |
| Confirm or complete a focused task | Dialog | It interrupts the page and needs a clear close or completion path. |
| Inspect longer content or a multi-step panel | Drawer | It offers room while preserving more page context. |
The same content can fit more than one surface. Choose based on task cost: deleting a record may deserve an Alert dialog confirmation; editing several fields may be easier in a Drawer. Do not put a whole workflow in a Tooltip just because it appears near the trigger.
Dialog, AlertDialog, and Command use a bottom Drawer with a grip up to 639px by default. Set mobilePresentation="dialog" to keep their centered presentation. Popover stays anchored unless you opt into mobilePresentation="drawer". Keep the same content and open state instead of maintaining two application surfaces; each component page includes its responsive example.
Is this a command, a form, or supporting information?
Menus represent a list of actions or menu choices. Use a Button for a direct action, and use a menu only when the user benefits from choosing among related commands. A Popover can contain a form or controls, but it does not become a menu: retain the semantics of the controls inside it. Tooltips should supplement an accessible name or visible instruction, not carry the only label.
Ghost's public pages show supported composition and installation for Dialog, Drawer, Popover, Tooltip, Dropdown Menu, and Context Menu. These components use the behavior and composition documented by Ghost; do not assume that Radix UI or React Aria props transfer directly. Radix UI and React Aria document their own overlay systems.
Who owns opening, closing, and the result?
Use uncontrolled open state for a self-contained disclosure. Use controlled state when the application must coordinate the overlay with routing, data, or another surface. A close event only closes the surface; it does not mean that a request succeeded or a form was saved. Keep pending, validation, success, and error results owned by the task's application state.
For destructive confirmation, state the consequence in the dialog and connect the confirm action to the real operation. If that operation can fail, keep the dialog open or show a clear recovery path according to the product flow. Never imply that the component itself deletes or persists records.
What should I check when an overlay is hard to use?
If users lose context, shorten the task or use a larger surface. If an overlay contains essential instructions, move them into visible content. Check the trigger name, close path, focus behavior, and narrow viewport in the actual composed application; a component name alone does not prove a whole workflow is usable. If trigger and overlay state drift, make one application owner control both.
For installation and source ownership, see Installation; for token and component CSS boundaries, see Styling. The source registry installs editable React source. The local package artifact is documented separately and should not be described as a published per-component package.