Dialog
A sheet of metal that asks for attention before anything else.
import { Button, Dialog } from '@rajatweb/argent'
<Dialog
title="Delete project?"
description="This cannot be undone."
trigger={<Button variant="outline">Delete</Button>}
footer={<Button variant="danger">Delete</Button>}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
title required | string | ||
children | string | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode> | ||
className | string | ||
closeLabel | string | 'Close' | Name of the close button. |
defaultOpen | boolean | ||
description | string | ||
footer | string | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode> | Actions, shown at the bottom. | |
onOpenChange | (open: boolean) => void | ||
open | boolean | ||
trigger | ReactElement<unknown, string | JSXElementConstructor<any>> | Element that opens the dialog. Leave out when you control `open`. |
Accessibility
- Holds focus and returns it when closed.
- Closes with Escape, or the back button on Android.
Do
- Say what will happen in the title.
Don’t
- Open a dialog from a dialog.