In the Figmaster - Lessons Figma file, open the 2.9 Modal page.
Introduction
Modals focus the user's attention exclusively on one task or piece of information via a window that sits on top of the page content. In this chapter, we'll create two simple modals. One will be used for informing the user. The second one will be a specific variant of transactional modal used for destructive or irreversible actions.
Step 1. Normal Modal
Part 1. Header
- Create a text layer with the following properties:
- Text: Modal title.
- Text Style: Heading/S.
- Text Color: Neutral/100.
- Open the Assets Panel and search for Icon / X.
- Drop the icon on the right from the Modal title.
- Group the Modal title and an icon.
- Rename the group to Header.
- Add auto layout.
- In the auto layout panel, set the following properties.
- Spacing between items: 8 px.
- Alignment: Left - Center.
- Select the Modal title and set its Resizing width property to Fill container.
- Resize the group, so it's 432 px wide.
Part 2. Text
- Create a text layer with the placeholder text inside: Assertively synthesize diverse value after enterprise data. Authoritatively embrace enterprise "outside the box" thinking without excellent imperatives. Rapidiously scale multidisciplinary innovation before proactive total linkage.
- Resize it, so it's 432 px wide.
- Change its text style to Text M/Regular.
- Change its color style to Neutral/90.
- Place it 8 px under the Header group.
Part 3. Buttons
- Grab the Button component from the Assets Panel and place it on the canvas.
- Set the following properties: Button / Text Only / Normal / Outlined / Default.
- The button text should be Cancel.
- Duplicate it 8 px to the right.
- The button on the right should have the following properties: Button / Text Only / Normal / Primary / Default.
- The button text should be Confirm.
- Group the buttons and add an auto layout.
- Rename this group to Buttons.
- In the auto layout panel, set the following properties:
- Padding Top: 16 px.
- Alignment: Top - Right.
- Resize the group to 432 px and place it 8 px below the Text.
Part 4. Wrapper
- Select all three elements.
- Group them and add an auto layout.
- Rename this group to Modal / Normal.
- Select all three elements inside and set their width Resizing property to Fill container.
- Resize it to 432 px.
- Set the padding of Modal / Normal to 24 px (all sides).
- Add Fill color Neutral/10.
- Set corner radius to 4 px.
- Add Stroke of 1 px Neutral/40 Inside.
- Add Shadow 2 effect.
Step 2. Danger Modal
- Duplicate the Modal / Normal 48 px to the right.
- Rename the new copy to Modal / Danger.
- Grab the Icon / WarningCircle from the Assets panel and drop it inside the Header group.
- Change its color to Danger/Main.
- Select the Primary Button inside the Button group.
- Change its Type property to Danger.
- Select the placeholder Text inside the group.
- Group it and apply the auto layout.
- Rename the Group to Text.
- Set its Resizing (width) property to Fill container.
- In the auto layout properties:
- Direction: Vertical.
- Padding Left: 32 px.
- Select the Text inside and set its Resizing width property to Fill container.
Step 3. Component
- Select both Modals.
- Create multiple components.
- Combine as variants.
- Property 1 should be Status.
Great job! I think you are ready for a small test of your skills in creating simple components. In the next chapter, you will practice it. Let's move on!