# Styling with Tailwind CSS

> Style React components quickly and consistently with utility classes, a shared design scale and component patterns. Free notes, key concepts, resources and a...

Canonical: https://www.internhack.in/roadmaps/tracks/full-stack/tailwind-css
Last updated: 2026-11-28

Style React components quickly and consistently with utility classes, a shared design scale and component patterns.

Intermediate · about 5 hours · difficulty 2/5

Learn first: [React Fundamentals](https://www.internhack.in/roadmaps/tracks/full-stack/react-fundamentals)

**Tailwind CSS** is the most common styling choice in new React and Next.js projects. Instead of writing separate CSS files, you compose small utility classes directly in your markup.

### Why teams use it

- A built-in scale for spacing, colours and type keeps designs consistent.
- No naming debates and no dead CSS; unused classes are removed at build time.
- Responsive and state variants (md:, hover:, focus-visible:, dark:) are right next to the element they affect.

### Working well with it

- Extract **components**, not custom CSS classes, when patterns repeat: a Button component with variants beats copying 15 classes.
- Use a helper like clsx or tailwind-merge for conditional classes.
- Configure theme colours and fonts once so the whole app follows your brand.
- Component libraries such as shadcn/ui give you accessible, copy-in components built on Tailwind.

### Pitfalls

- Learning Tailwind without CSS. You will not know which utility you need, or why a layout breaks.
- Extremely long class strings repeated across files instead of extracting components.
- Ignoring focus styles because they are not in the design.

You are ready to move on when you can rebuild your internship board UI in Tailwind with a reusable Button and Card, dark mode, and a mobile-first responsive layout.

## Key concepts

- **Utility classes and the design scale**
- **Responsive and state variants**
- **Dark mode**
- **Theme configuration**
- **Component extraction with variants**
- **clsx and tailwind-merge**
- **shadcn/ui**

## Other options for this step

- [Styling with CSS Modules](https://www.internhack.in/roadmaps/tracks/full-stack/css-modules): Write plain CSS scoped to each component, with no runtime cost and full access to modern CSS features.

## Mini project

Restyle your internship board with Tailwind: a themed Button with primary, secondary and danger variants, responsive card grid, accessible focus states and a dark mode toggle.

## Check yourself

The same 12 Tailwind classes appear on 20 buttons. What is the right way to remove the duplication?

## Free resources

- [Tailwind CSS Documentation](https://tailwindcss.com/docs) (Tailwind CSS)
- [shadcn/ui](https://ui.shadcn.com/docs) (shadcn/ui)

Previous: [Forms and User Input](https://www.internhack.in/roadmaps/tracks/full-stack/forms) · Next: [Styling with CSS Modules](https://www.internhack.in/roadmaps/tracks/full-stack/css-modules)

## More in React for Interfaces

- [React Fundamentals](https://www.internhack.in/roadmaps/tracks/full-stack/react-fundamentals)
- [State, Effects and Hooks](https://www.internhack.in/roadmaps/tracks/full-stack/react-hooks-and-state)
- [Forms and User Input](https://www.internhack.in/roadmaps/tracks/full-stack/forms)
- [Styling with Tailwind CSS](https://www.internhack.in/roadmaps/tracks/full-stack/tailwind-css)
- [Styling with CSS Modules](https://www.internhack.in/roadmaps/tracks/full-stack/css-modules)
- [Server State with TanStack Query](https://www.internhack.in/roadmaps/tracks/full-stack/server-state-tanstack-query)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Full-Stack Developer Roadmap](https://www.internhack.in/roadmaps/tracks/full-stack)
