IFFDAYIFFDAYDesign
Controls

Dialog

A modal dialog; on narrow screens the same dialog becomes a bottom sheet.

import { Dialog, DialogClose } from '@iffday/ui';

Example

On wide screens the dialog is centred and at most 560px wide. Below 768px the same dialog rises from the bottom of the screen as a sheet. While it is open the page behind stops scrolling and focus stays inside; Escape closes it and returns focus to the trigger. The close button in the corner comes with it.

Usage

  • title is required: it is the dialog’s accessible name. Put explanations in description.
  • Make Cancel a DialogClose, so you do not manage open for it.
  • Pass open and onOpenChange to control it; when one button opens it, trigger is enough.

Props

A modal dialog; on narrow screens the same popup becomes a bottom sheet.

PropTypeDefault
openboolean
onOpenChange(open: boolean) => void
title*ReactNode
descriptionReactNode
triggerReactElement<Record<string, unknown>>
children*ReactNode
classNamestring''

Exports BaseDialog.Close as it is, with Base UI’s props (see the Base UI documentation).

Not used directly in apps/web yet.