In the Figmaster - Lessons Figma file, open the 2.4 Card page.
Introduction
Cards are surfaces that display content and actions on a single topic. In this chapter, we will create a simple responsive card component. We'll use auto-layout so the content of the Card will behave accordingly when resized.
Step 1. Text Wrapper
Part 1. Header
- Open the text tool, click on a canvas and type in Card label.
- Change the text style to Heading/S.
- Change the color to Neutral/100 color style.
- Copy this placeholder text: Credibly reintermediate client focused growth strategies with functional initiatives.
- Open the text tool, click on a canvas and paste the text.
- Change the text style to Text M/Regular.
- Change the color to Neutral/80 color style.
- Move the text, so it's 8 px at the bottom of the heading.
- Select both text elements and group them.
- Change the group's name to Header.
- Add an auto-layout.
- Select both text elements inside the group and set their width Resizing property to Fill container.
Part 2. Date
- Open the text tool, click on a canvas, and type in Published on 24 Jan, 2021.
- Change the text style to Text S/Regular.
- Change the color to Neutral/70 color style.
- Move it 16 px below the Header group.
Part 3. Wrapper
- Select the date and Header group.
- Group it and apply the auto layout.
- Rename it to Text Wrapper.
- Select both text elements inside the Text Wrapper group and set their width Resizing property to Fill container.
- Add padding of 24 px (all sides) to the Text Wrapper.
- Add a Neutral/10 Fill color style.
- Set the bottom Corner radius to 4 px.
- Resize the Text Wrapper, so it's 280 px wide.
Step 2. Image
- Press R on your keyboard to open the rectangle tool.
- Click on the canvas to create a rectangle.
- Resize it, so it's 280 px wide and 200 px high.
- Set its top Corner radius to 4 px.
- Go here and copy the image.
- Select the rectangle and paste CTRL + V the image.
Step 3. Card
- Select the Image rectangle and Text Wrapper.
- Group them and apply the auto layout.
- Rename the group to Card / Default.
- In the Auto layout panel, set Spacing between items to 0 px.
- Select both elements inside the group and change their width Resizing property to Fill container.
- Select the Card and set its Stroke to 1 px Neutral/40 Outside.
- Add Shadow 1 effect.
- Set the corner radius (all sides) to 4 px.
Step 4. Card states
- Duplicate the Card / Default 48 px to the right.
- Rename the new copy to Card / Hover.
- Change the color of the Stroke to Primary/Main.
- Duplicate the Card / Hover 48 px to the right.
- Rename it to Card.
- Group it and apply the auto layout.
- Select the Card group inside and set its Resizing (width) property to Fill container.
- Rename the new group to Card / Focused.
- Set its Corner radius to 5 px.
- Add a stroke of 4px Primary/Focus Outside.
Step 5. Component and variants
- Select all cards.
- Create multiple components.
- Combine as variants.
- Rename Property 1 label to State.
- Rearrange States with your mouse to Default, Hover, Focused.
- Select the Card / Focused component.
- In the Stroke panel, add 3 px Outside Stroke with Primary/Focus color style.
Great work! You've just created a responsive card component! Let's move on to the next chapter.