Styling

Tailwind CSS / CSS Modules / styled-components

Our pick

Tailwind CSS

Just add class names to style things, with no jumping between files. It also pairs well with shadcn/ui

Compare the result

We built the same thing with each library. Try them out.

Tailwind CSS
CSS Modules
styled-components

Compare the code

Edit the code and the preview on the right updates.

export default function App() {
  return (
    <div className="m-4 rounded-xl border p-6">
      <h2 className="text-lg font-semibold">My first card</h2>
      <p className="mt-2 text-sm text-gray-500">
        The heading, description, and button are styled with class names alone.
      </p>
      <button className="mt-4 rounded-lg bg-black px-4 py-2 text-sm text-white hover:bg-gray-700">
        Learn more
      </button>
    </div>
  )
}

Comparison

As of September 2026

Tailwind CSS

Our pickOfficial site ↗

Features

Style elements by lining up class names (like p-4 or text-lg)

Best for

You want to build fast. You use shadcn/ui

Features

Write plain CSS in a separate file for each component. Class names never clash with others

Best for

You're comfortable with CSS and want to write it as-is

styled-components

Official site ↗

Features

Write CSS inside JavaScript to create components that come with their own styles

Best for

Working on a project that already uses it (for new projects, the other two are better)