Bird
Raised Fist0
Figmabi_tool~10 mins

Device-specific frames (mobile, desktop, tablet) in Figma - Interactive Code Practice

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a mobile frame with the correct preset size.

Figma
const mobileFrame = figma.createFrame();
mobileFrame.resize([1], 812);
Drag options to blanks, or click blank then click option'
A375
B1024
C1440
D1920
Attempts:
3 left
💡 Hint
Common Mistakes
Using desktop or tablet widths for mobile frames.
2fill in blank
medium

Complete the code to set the frame name to 'DESKTOP' for a desktop frame.

Figma
const desktopFrame = figma.createFrame();
desktopFrame.name = '[1]';
Drag options to blanks, or click blank then click option'
ADESKTOP
BMOBILE
CTABLET
DCANVAS
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'MOBILE' or 'TABLET' for desktop frames.
3fill in blank
hard

Fix the error in the code to create a tablet frame with correct width.

Figma
const tabletFrame = figma.createFrame();
tabletFrame.resize([1], 1024);
Drag options to blanks, or click blank then click option'
A375
B1920
C768
D1440
Attempts:
3 left
💡 Hint
Common Mistakes
Using mobile or desktop widths for tablet frames.
4fill in blank
hard

Fill both blanks to create a desktop frame with width 1440 and height 1024.

Figma
const desktopFrame = figma.createFrame();
desktopFrame.resize([1], [2]);
Drag options to blanks, or click blank then click option'
A1440
B1024
C768
D375
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping width and height values.
5fill in blank
hard

Fill all three blanks to create a mobile frame, set its name, and resize it correctly.

Figma
const mobileFrame = figma.createFrame();
mobileFrame.name = '[1]';
mobileFrame.resize([2], [3]);
Drag options to blanks, or click blank then click option'
AMOBILE
B375
C812
DDESKTOP
Attempts:
3 left
💡 Hint
Common Mistakes
Using desktop name or wrong sizes for mobile frames.

Practice

(1/5)
1.

What is the main purpose of using device-specific frames in Figma?

easy
A. To design layouts optimized for mobile, tablet, and desktop screens
B. To add animations to your design
C. To create 3D models within your design
D. To export designs only as PDFs

Solution

  1. Step 1: Understand device-specific frames

    Device-specific frames are preset sizes in Figma for mobile, tablet, and desktop screens.
  2. Step 2: Identify their purpose

    They help designers create layouts that fit each device's screen size properly.
  3. Final Answer:

    To design layouts optimized for mobile, tablet, and desktop screens -> Option A
  4. Quick Check:

    Device-specific frames = optimized layouts [OK]
Hint: Remember: device frames match screen sizes for better design [OK]
Common Mistakes:
  • Confusing frames with animation tools
  • Thinking frames create 3D models
  • Assuming frames only export PDFs
2.

Which of the following is the correct way to add a mobile device frame in Figma?

1. Click Frame tool
2. Select Mobile preset
3. Draw frame on canvas
easy
A. Use Rectangle tool and resize manually to mobile size
B. Click Text tool, type 'Mobile', then draw frame
C. Import a mobile image and trace it
D. Click Frame tool, select Mobile preset, then draw frame on canvas

Solution

  1. Step 1: Use Frame tool for device frames

    Figma's Frame tool includes presets for devices like Mobile, Tablet, Desktop.
  2. Step 2: Select Mobile preset and draw

    Selecting the Mobile preset sets the correct size automatically when you draw the frame.
  3. Final Answer:

    Click Frame tool, select Mobile preset, then draw frame on canvas -> Option D
  4. Quick Check:

    Frame tool + Mobile preset = correct method [OK]
Hint: Use Frame tool presets for exact device sizes [OK]
Common Mistakes:
  • Using Text tool instead of Frame tool
  • Manually resizing rectangles instead of presets
  • Importing images instead of using frames
3.

Given a desktop frame of width 1440px and a button constrained to the left and right edges, what happens if you resize the frame to 1200px width?

medium
A. The button width shrinks to fit the new frame width
B. The button stays the same size and overflows the frame
C. The button disappears from the frame
D. The button moves to the center but keeps original width

Solution

  1. Step 1: Understand constraints on button

    Constraining left and right edges means the button resizes horizontally with the frame.
  2. Step 2: Effect of resizing frame width

    When the frame width shrinks from 1440px to 1200px, the button width also shrinks to fit inside.
  3. Final Answer:

    The button width shrinks to fit the new frame width -> Option A
  4. Quick Check:

    Left-right constraints = button resizes [OK]
Hint: Left-right constraints resize width with frame [OK]
Common Mistakes:
  • Assuming button size stays fixed
  • Thinking button disappears
  • Believing button centers but keeps size
4.

You created a tablet frame and placed an image inside it. The image is set to fixed size but you want it to resize proportionally when the frame changes size. What is the error and how to fix it?

medium
A. You must group the image with the frame to resize together
B. The image's constraints are set to 'Fixed'; change constraints to 'Scale' to resize proportionally
C. The image is raster; convert to vector to resize
D. The frame size is locked; unlock it to resize the image

Solution

  1. Step 1: Identify the problem with fixed size

    Fixed size means the image does not change size when the frame resizes.
  2. Step 2: Change constraints to allow scaling

    Setting constraints to 'Scale' makes the image resize proportionally with the frame.
  3. Final Answer:

    The image's constraints are set to 'Fixed'; change constraints to 'Scale' to resize proportionally -> Option B
  4. Quick Check:

    Fixed size blocks resizing; use Scale constraints [OK]
Hint: Use 'Scale' constraints for proportional resizing [OK]
Common Mistakes:
  • Trying to unlock frame instead of changing constraints
  • Confusing raster/vector with resizing behavior
  • Grouping instead of adjusting constraints
5.

You want to design a responsive dashboard that works on mobile, tablet, and desktop using device-specific frames. Which approach best ensures your design adapts smoothly across devices?

hard
A. Use one large frame and crop it differently for each device
B. Design only for desktop and scale down manually for other devices
C. Create separate frames for each device preset and use constraints to adjust elements within each frame
D. Design only for mobile and stretch elements for larger screens

Solution

  1. Step 1: Understand device-specific frames for responsiveness

    Using separate frames for mobile, tablet, and desktop lets you design layouts tailored to each screen size.
  2. Step 2: Use constraints inside each frame

    Constraints help elements resize or reposition smoothly when frame size changes, ensuring adaptability.
  3. Final Answer:

    Create separate frames for each device preset and use constraints to adjust elements within each frame -> Option C
  4. Quick Check:

    Separate frames + constraints = smooth responsive design [OK]
Hint: Use separate frames plus constraints for best responsiveness [OK]
Common Mistakes:
  • Designing only for desktop or mobile and scaling manually
  • Using one frame and cropping instead of designing per device
  • Ignoring constraints for element resizing