Complete the code to import the CSS module correctly in a Next.js component.
import styles from '[1]'; export default function Button() { return <button className={styles.btn}>Click me</button>; }
.module in the name.You must import the CSS module file with the exact module name ending in .module.css to use CSS Modules in Next.js.
Complete the code to apply a CSS module class to a div element.
export default function Card() {
return <div className=[1]>Content</div>;
}Use styles.card to apply the CSS module class named card to the element.
Fix the error in the code to correctly apply multiple CSS module classes to a button.
export default function SubmitButton() {
return <button className={`$[1] ${styles.primary}`}>Submit</button>;
}styles. prefix inside template strings.Use styles.btn to correctly reference the CSS module class for btn inside the template string.
Fill both blanks to create a CSS module style object with dynamic class names.
const buttonClass = `$[1] [2]`; export default function Button() { return <button className={buttonClass}>Press</button>; }
styles. prefix.Use styles.btn and styles.active to combine CSS module classes dynamically.
Fill all three blanks to create a CSS module style object with conditional class names.
const isActive = true; const className = `$[1] $[2] ? [3] : ''`; export default function Toggle() { return <div className={className}>Toggle me</div>; }
Use styles.toggle as the base class, check the isActive boolean, and conditionally add styles.active if true.