0
0
Figmabi_tool~10 mins

Base component architecture 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 base component in Figma.

Figma
const BaseComponent = () => {
  return <div className=[1]>Base Component</div>;
};
Drag options to blanks, or click blank then click option'
Awrapper
Bcontainer
Cbase-style
Dcomponent
Attempts:
3 left
💡 Hint
Common Mistakes
Using generic class names like 'container' or 'wrapper' instead of 'base-style'.
2fill in blank
medium

Complete the code to extend the base component with additional styles.

Figma
const ExtendedComponent = () => {
  return <div className=[1]>Extended Component</div>;
};
Drag options to blanks, or click blank then click option'
Aextended-style
Bbase-style extended-style
Cbase-style
Dcomponent-style
Attempts:
3 left
💡 Hint
Common Mistakes
Using only 'extended-style' without the base styles.
3fill in blank
hard

Fix the error in the component to correctly apply the base styles.

Figma
const Component = () => {
  return <div className=[1]>Component</div>;
};
Drag options to blanks, or click blank then click option'
Abase-style
BbaseStyle
CBaseStyle
Dbase_style
Attempts:
3 left
💡 Hint
Common Mistakes
Using camelCase or underscores instead of hyphenated lowercase.
4fill in blank
hard

Fill both blanks to create a reusable base component with props.

Figma
const BaseComponent = ({ children, className }) => {
  return <div className=[1] + ' ' + [2]>{children}</div>;
};
Drag options to blanks, or click blank then click option'
A'base-style'
BclassName
C'extended-style'
Dchildren
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'children' or 'extended-style' in the className concatenation.
5fill in blank
hard

Fill all three blanks to create a styled base component with conditional class names.

Figma
const BaseComponent = ({ isActive, children }) => {
  const baseClass = [1];
  const activeClass = isActive ? [2] : '';
  return <div className={`${baseClass} ${activeClass} [3]`}>{children}</div>;
};
Drag options to blanks, or click blank then click option'
A'base-style'
B'active-style'
C'custom-style'
D'inactive-style'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up active and inactive class names or missing the custom style.