Dialog
Accessible dialog based on Reach UI's Dialog.
Usage
import { Dialog } from '@binarycapsule/ui-capsules';
Knobs 🎛
warning
<Dialog
isOpen={false}
variant="warning"
onRequestClose={() => setIsOpen(false)}
contentLabel="Example dialog"
actions={[
{
text: 'Cancel',
variant: 'neutral',
onClick: () => setIsOpen(false),
},
{
text: 'Delete file',
variant: 'error',
onClick: () => alert('Delete action called'),
},
]}
title={Delete file}
message={Are you sure you want to delete this file?}
/>
Props
Name | Description |
---|---|
isOpenRequired | boolean The open state of the dialog. |
actionsRequired | Action[] An array of objects. Each object represents an action in the Dialog footer (see example above). |
contentLabelRequired | string String indicating how the content container should be announced to screen-readers. |
onCloseRequired | function Function that closes the Dialog. |
title | string(Default: undefined) The title of the dialog. |
messageRequired | string The message that is displayed inside the dialog. |
Note:
This component accepts all props from DialogOverlay props. Please refer to the Reach UI docs for more information.