Dialog
<bh-dialog>
| BharatDialog
The Dialog component provides a modal interface for interactions like confirmations, alerts, or custom messages. It supports multiple variants, custom button texts, and dynamic open/close behavior.
Open in Open Dialog
Basic Usage
Open in Open Dialog
<bh-buttononclick='showDialog({header: "Dialog",message: "Lorem ipsum dolor sit amet, consectetur adipiscing elit."})'>Open Dialog</bh-button>
import React from 'react';import { BharatButton } from 'bharat-ui/react/components/button'import { BharatDialog, showDialog } from 'bharat-ui/react/components/dialog'function App() {return ( <BharatButton onclick='showDialog({ header: "Dialog", message: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." })'>Open Dialog</BharatButton>);}export default App;
Properties
Property | Type | Description |
---|---|---|
show | boolean | Whether the dialog is open |
header | string | Header label text |
message | string | Header label text |
Methods
Method | Description |
---|---|
showDialog(options) | Function call to display the dialog, takes options object as a parameter. e.g - { header: "Dialog", message: "Lorem ipsum dolor.",} |