Modal form
import { useState } from 'react';
import { Modal } from '@citizensadvice/react-dialogs';
export function Example() {
const [show, setShow] = useState();
return (
<>
<button
type="button"
onClick={() => setShow(!show)}
aria-expanded={show ? 'true' : 'false'}
aria-haspopup="dialog"
>
Toggle
</button>
{show && (
<Modal
title="Modal title"
onClose={() => setShow(false)}
renderWrapper={(props) => <form method="dialog" {...props} />}
footer={<input type="submit" value="Submit" />}
>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
<p>
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat.
</p>
<p>
Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur.
</p>
</Modal>
)}
</>
);
}