UI: Dialog
A modal dialog with a title, content and a row of actions. Import the token file once (@pithyx/ui/tokens.css) and wrap the app in UiProvider; see @pithyx/ui.
Generated from the TSDoc comments of @pithyx/ui 1.0.0-rc.9 at build time; the text below the headings is the comment in the source.
Interfaces
Section titled “Interfaces”DialogProps
Section titled “DialogProps”The props of Dialog: React Aria’s modal props plus title, content and actions.
Extends
Section titled “Extends”Omit<ModalOverlayProps,"className"|"children">
Properties
Section titled “Properties”title: ReactNode;The heading, also the dialog’s accessible name.
optional icon?: ReactNode;An icon before the title.
optional tone?: "danger" | "default";danger for a destructive question; default when left out.
optional role?: "dialog" | "alertdialog";alertdialog for a question that interrupts the user; dialog when left out.
optional size?: "medium" | "default" | "large";medium for longer forms such as a user with its rights; large for side-by-side content (the pool wizard).
children
Section titled “children”children: ReactNode;The content.
actions
Section titled “actions”actions: ReactNode;The buttons at the bottom, usually a Button each.
Functions
Section titled “Functions”Dialog()
Section titled “Dialog()”function Dialog(props): Element;A modal dialog with a title, content and a row of actions. Open it with isOpen and onOpenChange, or inside a
React Aria DialogTrigger; Escape and a press outside close it unless isDismissable is false.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
props |
DialogProps |
React Aria’s modal overlay props plus title, content and actions. |
Returns
Section titled “Returns”Element
The modal overlay with the dialog.
Example
Section titled “Example”<Dialog title="Delete 3 files?" tone="danger" role="alertdialog" isOpen={open} onOpenChange={setOpen} actions={ <Button variant="danger" onPress={remove}> Delete </Button> }> They go to the recycle bin.</Dialog>