Skip to content

Commit 1daa0b6

Browse files
Ingrid HagelundIngrid Hagelund
Ingrid Hagelund
authored and
Ingrid Hagelund
committed
Update modal.mdx
Added modal images
1 parent 7b29ab3 commit 1daa0b6

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

docs/components/modal.mdx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,37 @@ thoughtfully and sparingly.
2020

2121
## Options
2222

23-
### Title
24-
25-
All dialogs must have a title. Titles appear in bold at the top of the dialog and use a few words to convey the outcome
26-
of what will happen if a user continues with an action.
23+
<Guideline title="Title" image="modal-options-title.svg">
24+
All modals must have a title. Titles appear in bold at the top of the dialog and use a few words to convey the outcome
25+
of what will happen if a user continues with an action.
26+
</Guideline>
2727

2828
## Behaviors
2929

30+
<Guideline title="Behaviors" image="modal-behaviors.svg">
3031
Modals should:
3132

3233
- Require that the user take an action.
3334
- Close when the user presses the `X` button, the `Cancel` button, the `Esc` key, or when they complete the main action.
3435
- Make all content behind the overlay become inactive.
36+
37+
</Guideline>
3538

3639
## Usage guidelines
3740

38-
### Keep it simple
39-
40-
Use modals when merchants must complete an action before they can continue with the main workflow. Avoid using modals to
41+
<Guideline title="Keep it simple" image="modal-usage-guidelines-1-do.svg" good>
42+
Use modals when merchants must complete an action before they can continue with the main workflow. Avoid using modals to
4143
display complex forms or large amounts of information.
44+
</Guideline>
4245

43-
### Two buttons only
44-
46+
<Guideline title="Two buttons only" image="modal-usage-guidelines-2-do.svg" good>
4547
Don't use more than two buttons (primary and secondary) at the bottom. This prevents unclear action hierarchy and
4648
crowding on mobile screens. Since modals are for focused tasks, they should have focused actions. In some cases however,
4749
a tertiary action may be appropriate.
50+
</Guideline>
51+
<Guideline image="modal-usage-guidelines-2-dont.svg" bad></Guideline>
4852

49-
### Button layout
50-
53+
<Guideline title="Button layout" image="modal-usage-guidelines-3-do.svg" good>
5154
The cancel action should always be to the left, while the main action is to the right. Buttons are placed at the bottom
5255
of the box.
56+
</Guideline>

0 commit comments

Comments
 (0)