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 install -D tailwindcss
yarn add -D tailwindcss
pnpm add -D tailwindcss
Import
@tailwind base; @tailwind components; @tailwind utilities;
Quick Example
<!-- 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
| Package | tailwindcss |
| Category | UI Component |
| Weekly Downloads | 12M+ |
| License | MIT |
| Install | npm install -D tailwindcss |
Related Packages
PostCSS is a tool for transforming CSS with JavaScript plugins, serving as the foundation for many m…
Autoprefixer is a PostCSS plugin that automatically adds vendor prefixes to CSS rules based on curre…
daisyUI is a popular Tailwind CSS component library that adds component classes (btn, card, modal, n…
shadcn/ui is not a component library in the traditional sense — it is a collection of reusable, beau…
Browse npm Packages by Category
Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.