Modals: Be more consistent with Modal cancel button styling (#68302)

* Modals: Be more consistent with Modal cancel button styling

* Update docs

* Fix tests

* fixing tests
This commit is contained in:
Torkel Ödegaard
2023-05-12 09:21:07 +02:00
committed by GitHub
parent 9cd585d533
commit debf04eb2c
15 changed files with 102 additions and 84 deletions
@@ -97,7 +97,7 @@ export const ConfirmModal = ({
) : null}
</div>
<Modal.ButtonRow>
<Button variant={dismissVariant} onClick={onDismiss}>
<Button variant={dismissVariant} onClick={onDismiss} fill="outline">
{dismissText}
</Button>
<Button
@@ -6,7 +6,26 @@ import { ModalTabsHeader } from './ModalTabsHeader';
# Modal
Generic Modal component
Generic Modal component.
Example usage:
```tsx
<Modal title="title" isOpen={true}>
<div>Some body</div>
<Modal.ButtonRow>
<Button variant="secondary" fill="outline">
Cancel
</Button>
<Button>Save</Button>
</Modal.ButtonRow>
</Modal>
```
For buttons at the bottom of the modal you should always use:
- Modal.ButtonRow - this makes sure the Buttons are right aligned
- If you have a Cancel button use fill="outline" and variant="secondary" and place it on the left side of any other button.
<ArgTypes of={Modal} />