Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@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,
DefaultDialogTemplate,
DialogSurface,
DialogHeader,
DialogHeaderTitle,
DialogBody,
DialogFooter,
DialogFooterButton,
DialogBackdrop
} from '@rmwc/dialog';
import { Button } from '@rmwc/button';
{/** Standard dialog usage */}
<Dialog
open={this.state.standardDialogOpen}
onClose={evt => this.setState({standardDialogOpen: false})}
>
<DialogSurface>
<DialogHeader>
<DialogHeaderTitle>Dialog Title</DialogHeaderTitle>
</DialogHeader>
<DialogBody>This is a standard dialog.</DialogBody>
<DialogFooter>
<DialogFooterButton cancel>Cancel</DialogFooterButton>
<DialogFooterButton accept>Sweet!</DialogFooterButton>
</DialogFooter>
</DialogSurface>
<DialogBackdrop />
</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 => this.setState({simpleDialogIsOpen: false})}
onAccept={evt => console.log('Accepted')}
onCancel={evt => console.log('Cancelled')}
/>
<Button
raised
onClick={evt => this.setState({simpleDialogIsOpen: true})}
>
Open Simple Dialog
</Button>
import { DocumentComponent } from '@rmwc/base/utils/DocumentComponent';
import * as docs from './docgen.json';
<DocumentComponent docs={docs} displayName="Dialog" />
<DocumentComponent docs={docs} displayName="DialogSurface" />
<DocumentComponent docs={docs} displayName="DialogHeader" />
<DocumentComponent docs={docs} displayName="DialogHeaderTitle" />
<DocumentComponent docs={docs} displayName="DialogBody" />
<DocumentComponent docs={docs} displayName="DialogFooter" />
<DocumentComponent docs={docs} displayName="DialogFooterButton" composes={['Button']} />
<DocumentComponent docs={docs} displayName="DialogBackdrop" />
<DocumentComponent docs={docs} displayName="SimpleDialog" />
FAQs
RMWC Dialog component
The npm package @rmwc/dialog receives a total of 5,140 weekly downloads. As such, @rmwc/dialog popularity was classified as popular.
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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.