![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@rmwc/dialog
Advanced tools
Dialogs inform users about a specific task and may contain critical information, require decisions, or involve multiple tasks.
Material Dialogs are a complex component. RMWC contains an additional non-standard SimpleDialog
component for ease of use that internally contains the default structure already built out. Illustrated below is both the strandard and simple dialog usage.
import {
Dialog,
DialogTitle,
DialogContent,
DialogActions,
DialogButton
} from '@rmwc/dialog';
import { Button } from '@rmwc/button';
{/** Standard dialog usage */}
<Dialog
open={this.state.standardDialogOpen}
onClose={evt => {
console.log(evt.detail.action)
this.setState({standardDialogOpen: false})
}}
>
<DialogTitle>Dialog Title</DialogTitle>
<DialogContent>This is a standard dialog.</DialogContent>
<DialogActions>
<DialogButton action="close">Cancel</DialogButton>
<DialogButton action="accept" isDefaultAction>Sweet!</DialogButton>
</DialogActions>
</Dialog>
<Button
raised
onClick={evt => this.setState({standardDialogOpen: true})}
>
Open standard Dialog
</Button>
import { SimpleDialog } from '@rmwc/dialog';
import { Button } from '@rmwc/button';
{/** Simple Dialog usage */}
<SimpleDialog
title="This is a simple dialog"
body="You can pass the body prop, or anything you want as children."
open={this.state.simpleDialogIsOpen}
onClose={evt => {
console.log(evt.detail.action)
this.setState({simpleDialogIsOpen: false})
}}
/>
<Button
raised
onClick={evt => this.setState({simpleDialogIsOpen: true})}
>
Open Simple Dialog
</Button>
import { Docs } from '@rmwc/base/utils/document-component';
import * as docs from './docgen.json';
<Docs src={docs} components={[
'Dialog',
'DialogTitle',
'DialogContent',
'DialogActions',
'DialogButton',
'SimpleDialog'
]} />
FAQs
RMWC Dialog component
We found that @rmwc/dialog demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.