"use client";
import { Dialog } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
title | ReactNode | — | Title, wired to aria-labelledby automatically. |
trigger | ReactElement | — | Element that toggles the dialog (gets aria-expanded/aria-controls). |
backdropProps | HTMLAttributes<HTMLDivElement> | — | Props for the backdrop / positioning layer behind the surface. |
closeLabel | string | from the message catalog | Accessible name of the close button (default from the message catalog). |
container | Element | DocumentFragment | null | document.body | Portal container (default document.body). |
defaultOpen | boolean | — | Initial open state when uncontrolled. |
description | ReactNode | — | Supporting text wired to aria-describedby. |
finalFocus | RefObject<HTMLElement | null> | the trigger, or the previously focused element | Element focused when the overlay closes (default: the trigger, or the previously focused element). |
footer | ReactNode | — | Footer slot. |
hideCloseButton | boolean | — | Hide the header close button. |
titleReactNode
Title, wired to aria-labelledby automatically.
triggerReactElement
Element that toggles the dialog (gets aria-expanded/aria-controls).
backdropPropsHTMLAttributes<HTMLDivElement>
Props for the backdrop / positioning layer behind the surface.
closeLabeldefault from the message catalogstring
Accessible name of the close button (default from the message catalog).
containerdefault document.bodyElement | DocumentFragment | null
Portal container (default document.body).
defaultOpenboolean
Initial open state when uncontrolled.
descriptionReactNode
Supporting text wired to aria-describedby.
finalFocusdefault the trigger, or the previously focused elementRefObject<HTMLElement | null>
Element focused when the overlay closes (default: the trigger, or the previously focused element).
footerReactNode
Footer slot.
hideCloseButtonboolean
Hide the header close button.
Other props are passed to the root element (HTMLAttributes<HTMLDivElement>), including className, style, id and aria-* attributes.
<Dialog title="Edit profile" trigger={<Button>Open dialog</Button>}>…</Dialog>