0
0
Figmabi_tool~10 mins

Nested components in Figma - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a nested component in Figma.

Figma
const Button = createComponent({ type: 'button', children: [1] });
Drag options to blanks, or click blank then click option'
AFrame
BIcon
CRectangle
DText
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a container like Frame instead of a content element.
Using a shape like Rectangle which is not typical inside buttons.
2fill in blank
medium

Complete the code to reference a nested component inside a main component.

Figma
const Card = createComponent({ children: [[1]] });
Drag options to blanks, or click blank then click option'
AHeader
BFooter
CIcon
DButton
Attempts:
3 left
💡 Hint
Common Mistakes
Using Footer which is usually at the bottom, not the main nested part.
Choosing Icon which is a smaller element, not the main nested component.
3fill in blank
hard

Fix the error in the nested component declaration.

Figma
const Modal = createComponent({ children: [1] });
Drag options to blanks, or click blank then click option'
A[Header, Content, Footer]
B{Header, Content, Footer}
CHeader, Content, Footer
D(Header, Content, Footer)
Attempts:
3 left
💡 Hint
Common Mistakes
Using curly braces which define an object, not an array.
Listing components without brackets which causes syntax errors.
4fill in blank
hard

Fill both blanks to correctly nest components with props.

Figma
const ListItem = createComponent({ type: 'list-item', children: [[1]], props: { text: [2] } });
Drag options to blanks, or click blank then click option'
AText
B'Item 1'
C'Button'
DIcon
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Button' as a string instead of 'Item 1' for the text prop.
Nesting Icon instead of Text inside the list item.
5fill in blank
hard

Fill all three blanks to create a nested component with multiple children and props.

Figma
const Toolbar = createComponent({ children: [[1], [2]], props: { size: [3] } });
Drag options to blanks, or click blank then click option'
AButton
BIcon
C'large'
D'small'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'small' instead of 'large' for the size prop.
Nesting only one child instead of two.