In the Figmaster - Lessons Figma file, open the 2.5 Checkbox page.
Introduction
It's time to create a checkbox component. Checkboxes allow the user to select one or more items from a set. First, we'll create a checkbox field. Then, we'll also create a checkbox with a text label.
Checkbox
Step 1. Checkbox Inactive
- Create a rectangle with the following properties:
- Size: 20x20 px.
- Fill color: Neutral/10.
- Stroke: 1 px Neutral/50 Inside.
- Corner radius: 4 px.
- Group it and change the group into a frame (Dropdown in the top right corner of the Figma UI).
- Change its name to Checkbox.
- Group it again.
- Rename the new group to Checkbox / Inactive / Default.
- Change its Corner radius to 4 px.
- Uncheck the Clip content option for this frame.
- Duplicate it 32 px to the right.
- Change the copy's name to Checkbox / Inactive / Hover.
- Change its stroke color to Primary / Main.
- Duplicate it 32 px to the right.
- Change the copy's name to Checkbox / Inactive / Focused.
- Duplicate it 32 px to the right.
- Change the copy's name to Checkbox / Inactive / Disabled.
- Change the Fill color to Neutral/20.
- Change the Stroke color to Neutral/40.
Step 2. Checkbox Indeterminate
- Duplicate all checkboxes 32 px to the bottom.
- Open the Rename modal.
- In the Match (optional) field, type in Inactive.
- In the Rename to field, type in Indeterminate and press Enter.
- Create a Rectangle with the following properties:
- Fill color: Primary/Main.
- Size: 10x10 px.
- Copy the rectangle.
- Paste it in the center of each Checkbox Indeterminate frame.
- Change the color of this rectangle to Neutral/50 inside the Checkbox / Indeterminate / Disabled.
Step 3. Checkbox Active
- Duplicate all Inactive checkboxes 32 px under the Indeterminate checkboxes.
- Open the Rename modal.
- In the Match (optional) field, type in Inactive.
- In the Rename to field, type in Active and press Enter.
- Remove the stroke from all rectangles in the Active Checkboxes.
- Set the Fill color of Default, Hover, and Focused Checkboxes to Primary/Main.
- Set the Fill color of Disabled Checkbox to Neutral/50.
- Open the Assets Panel with ALT + 2.
- Search for Icon / Check and place it on the canvas.
- Change its size to 20 px.
- Change its color to Neutral/10.
- Copy it.
- Paste it in each Active Checkbox's frame.
Step 4. Focused State
- Select all Focused components.
- Press Enter to select all Frames inside.
- In the Stroke panel, add 3 px Outside stroke with Primary/Focus color style.
Step 5. Component and variants
- Select all Checkboxes.
- Create multiple components.
- Select all components and set its Auto layout's property Spacing between items to 8 px.
- Alignment to Left - Center.
- Having the component selected, press the Combine as variants button.
- Rename Property 1 label to Status.
- Rename Property 2 label to State.
- Rearrange the states to Default, Hover, Focused, Disabled.
Checkbox + Label
Step 5. Adding the label
- Select the Checkbox component with all variants inside (Variants group surrounded with a purple dashed stroke).
- Duplicate it 48 px to the right.
- Select the new copy.
- Rename it to Checkbox + Label.
- Resize the variants area, so it's 655px wide.
- Select all variants inside.
- Set the horizontal spacing between them to 144 px (top right corner of the Figma UI, where you set up the Corner radius).
- Create a Checkbox text label with the text tool.
- Set its text style to Text M/Regular.
- Set its color style to Neutral/90.
- Copy the text layer.
- Paste it in each Checkbox component inside the Checkbox + Label variants group.
- Change the color of the text layer in each Disabled checkbox component to Neutral / 60.
Awesome work! Let's move on!