Argent

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

PropTypeDefaultWhat it does
title requiredstring
childrenstring | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode>
classNamestring
closeLabelstring'Close'Name of the close button.
defaultOpenboolean
descriptionstring
footerstring | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode>Actions, shown at the bottom.
onOpenChange(open: boolean) => void
openboolean
triggerReactElement<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.