Dialog

Overlays

A focused modal surface with title, description, footer and a backdrop.

Live preview

Installation

Import the component from the kit. The package ships source and is transpiled by Next.js.

Import
import * as React from "react";
import { Button, Dialog } from "@nphuonha/ui-kit";

Usage

Compose the component with your own content. All controls share the same focus, disabled and invalid states.

Usage
<Dialog open={open} onOpenChange={setOpen} title="Title">
Content
</Dialog>

API Reference

Props are additive to the underlying Base UI or native element.

PropTypeDefaultDescription
openboolean—Controlled open state.
defaultOpenboolean—Uncontrolled initial state.
onOpenChange(open: boolean) => void—Called when the dialog opens or closes.
triggerReactElement—Element that opens the dialog.
titleReactNode—Dialog title.
descriptionReactNode—Supporting description.
footerReactNode—Actions rendered at the bottom.
showClosebooleantrueShows the close icon button.