🎨
UI Component12M+/wkMIT

tailwindcss

Tailwind CSS is a utility-first CSS framework that provides low-level utility classes for building custom designs without writing custom CSS. Instead of pre-des

Installation

npm
npm install -D tailwindcss
yarn
yarn add -D tailwindcss
pnpm
pnpm add -D tailwindcss

Import

ESM
@tailwind base;
@tailwind components;
@tailwind utilities;

Quick Example

usage
<!-- Tailwind utility classes in HTML -->
<div class="flex items-center gap-4 p-6 bg-white rounded-xl shadow-md">
  <img class="w-12 h-12 rounded-full" src="avatar.jpg" alt="" />
  <div>
    <p class="text-lg font-semibold text-gray-900">Alice</p>
    <p class="text-sm text-gray-500">Developer</p>
  </div>
</div>

About tailwindcss

Tailwind CSS is a utility-first CSS framework that provides low-level utility classes for building custom designs without writing custom CSS. Instead of pre-designed components, Tailwind gives you classes like flex, pt-4, text-center, and bg-blue-500 that you compose directly in your HTML to build any design. The framework's configuration file (tailwind.config.js) allows complete customization of colors, spacing, typography, breakpoints, and every other design token. Tailwind uses a JIT (Just-in-Time) engine that generates only the CSS classes you actually use, keeping production bundles tiny regardless of how many utilities are available. The framework supports responsive design with breakpoint prefixes (md:flex), state variants (hover:bg-blue-700, focus:ring), dark mode (dark:bg-gray-900), and arbitrary values (w-[137px]) for one-off measurements. Tailwind's plugin system extends the framework with custom utilities, components, and variants. The framework has fundamentally changed how many developers write CSS, favoring colocation of styles with markup over separate stylesheet files. Tailwind CSS works with any JavaScript framework and is the most popular CSS framework in modern web development.

Quick Facts

Packagetailwindcss
CategoryUI Component
Weekly Downloads12M+
LicenseMIT
Installnpm install -D tailwindcss

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.