Dialog
The Dialog component is used to show dialog popup.
1. Import
KUMUI exports 8 Dialog-related components:
import { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, DialogClose } from "@rohitgadekar/kimui";
2. Usage
3. API
3.1 Dialog
| Attribute | Type | Description | Default |
|---|---|---|---|
| children | React.ReactNode | Dialog components, such as trigger, content, header, footer, etc. | - |
3.2 DialogTrigger
| Attribute | Type | Description | Default |
|---|---|---|---|
| asChild | boolean | If true, it will wrap the trigger component (Button) as a child | false |
3.3 DialogContent
| Attribute | Type | Description | Default |
|---|---|---|---|
| children | React.ReactNode | Content of the Dialog, such as the header, description, and footer | - |
3.4 DialogHeader
| Attribute | Type | Description | Default |
|---|---|---|---|
| children | React.ReactNode | Header content for the Dialog, such as a title | - |
3.5 DialogTitle
| Attribute | Type | Description | Default |
|---|---|---|---|
| children | React.ReactNode | The title text of the dialog | - |
3.6 DialogDescription
| Attribute | Type | Description | Default |
|---|---|---|---|
| children | React.ReactNode | Content for the description of the dialog (e.g., instructions or additional details) | - |
| className | string | Custom CSS class for styling | - |
3.7 DialogFooter
| Attribute | Type | Description | Default |
|---|---|---|---|
| children | React.ReactNode | Footer content, typically used for actions like close or submit | - |
3.8 DialogClose
| Attribute | Type | Description | Default |
|---|---|---|---|
| children | React.ReactNode | The content that triggers the closing of the dialog (usually a button) | - |