Dialog
StableThis component has limited functionality on the server side. In Next.js, add
"use client" at the top to make it work.A modal dialog component for displaying important content that requires user attention or interaction.
Import
TypeScript React
import { Dialog } from "laxod";Basic Usage
A simple dialog with a title, description, and custom content.
Basic Dialog
Confirmation Dialog
Use dialogs to confirm destructive or important actions.
Confirmation Dialog
Form Dialog
Dialogs can contain forms and input fields for collecting user data.
Form Dialog
Controlled Dialog
Control the dialog's open state programmatically using the open and onOpenChange props.
Controlled Dialog
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | - | Title text displayed at the top |
| children | ReactNode | - | Content to display in the dialog |
| description | string | - | Optional description below the title |
| trigger | ReactNode | - | Element that opens the dialog when clicked |
| open | boolean | - | Controlled open state |
| onOpenChange | (open: boolean) => void | - | Callback when open state changes |