Sourceful Energy

Dialog

A modal dialog that interrupts the user with important content and expects a response.

Installation

import {
  Dialog,
  DialogContent,
  DialogDescription,
  DialogFooter,
  DialogHeader,
  DialogTitle,
  DialogTrigger,
} from "@sourceful-energy/ui"

Usage

Examples

Add Device

Confirmation Dialog

Settings Dialog

Props

PropTypeDefaultDescription
openboolean-The controlled open state of the dialog.
defaultOpenbooleanfalseThe default open state when uncontrolled.
onOpenChange(open: boolean) => void-Callback when the open state changes.

Accessibility

  • Built on Radix UI Dialog for full accessibility
  • Focus is trapped within the dialog
  • Escape key closes the dialog
  • Background scroll is locked when open
  • Announces content to screen readers