@reach-ui-fork/dialog
v0.18.1
Published
Accessible React Modal Dialog.
Downloads
69
Readme
@reach-ui-fork/dialog
An accessible dialog or modal window.
import { Dialog } from "@reach-ui-fork/dialog";
import "@reach-ui-fork/dialog/styles.css";
function Example(props) {
const [showDialog, setShowDialog] = React.useState(false);
const open = () => setShowDialog(true);
const close = () => setShowDialog(false);
return (
<div>
<button onClick={open}>Open Dialog</button>
<Dialog isOpen={showDialog} onDismiss={close}>
<button className="close-button" onClick={close}>
<VisuallyHidden>Close</VisuallyHidden>
<span aria-hidden>×</span>
</button>
<p>Hello there. I am a dialog</p>
</Dialog>
</div>
);
}