0
0
Tailwindmarkup~5 mins

Tailwind with React components - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is Tailwind CSS?
Tailwind CSS is a utility-first CSS framework that provides small, reusable classes to style HTML elements quickly without writing custom CSS.
Click to reveal answer
beginner
How do you apply Tailwind styles in a React component?
You add Tailwind utility classes to the className attribute of JSX elements inside React components.
Click to reveal answer
beginner
Why use className instead of class in React?
React uses <code>className</code> because <code>class</code> is a reserved word in JavaScript. <code>className</code> sets the HTML class attribute.
Click to reveal answer
intermediate
What is the benefit of using Tailwind with React components?
It allows fast styling with consistent design, avoids writing custom CSS files, and keeps styles close to the component code for easier maintenance.
Click to reveal answer
intermediate
How can you make a React component responsive using Tailwind?
Use Tailwind's responsive prefixes like sm:, md:, lg: before utility classes to apply styles at different screen sizes.
Click to reveal answer
Which attribute do you use to add Tailwind classes in a React component?
AclassName
Bclass
Cstyle
Did
What does the Tailwind class bg-blue-500 do?
ASets text color to blue
BSets background color to a medium blue
CAdds a blue border
DMakes the element blue on hover
How do you apply styles only on medium screens and larger in Tailwind?
Amd: before the class
Bsm: before the class
Clg: after the class
DUse media queries in CSS
Which of these is a benefit of using Tailwind with React?
AStyles are inline and hard to maintain
BTailwind does not support React
CYou write less CSS and style faster
DYou must write custom CSS for every component
What is the correct way to add multiple Tailwind classes in React JSX?
Aclass="p-4 bg-red-300 text-center"
BclassName={p-4 bg-red-300 text-center}
Cstyle="p-4 bg-red-300 text-center"
DclassName="p-4 bg-red-300 text-center"
Explain how to use Tailwind CSS classes inside a React component to style a button.
Think about how you add CSS classes in HTML and how React uses className.
You got /4 concepts.
    Describe how Tailwind helps make React components responsive.
    Consider how screen size changes the look of a website.
    You got /4 concepts.