Tailwind CSS Class Reference
Interactive searchable reference for Tailwind CSS utility classes with live previews, CSS output, and arbitrary value support
Updated
What is the Tailwind CSS Class Reference?
The Tailwind CSS Class Reference is a comprehensive, searchable documentation tool for Tailwind CSS utility classes. Whether you are learning Tailwind, need a quick reminder, or want to explore what is possible, this reference provides instant access to over 150 core utility classes with live visual previews, generated CSS output, and arbitrary value experimentation.
What Makes This Different
Unlike static cheat sheets or the official documentation, this tool offers:
- Instant fuzzy search — find classes by name, description, or category
- Live visual previews — see exactly how colors, shadows, spacing, and transforms appear
- CSS output generation — view the raw CSS for any class in multiple formats
- Arbitrary value playground — test custom values like
p-[20px]orbg-[#ff0000]with validation - Dark mode previews — toggle between light and dark backgrounds for color classes
Coverage
The reference includes essential utility categories:
| Category | Example Classes |
|---|---|
| Layout | container, flex, grid, absolute, z-50 |
| Flexbox & Grid | flex-row, gap-4, grid-cols-3, justify-center |
| Spacing | p-4, m-auto, px-6, my-8 |
| Sizing | w-full, h-screen, min-w-0, max-w-md |
| Typography | text-xl, font-bold, leading-tight, tracking-wide |
| Backgrounds | bg-white, bg-slate-500, bg-gradient-to-r |
| Borders | rounded-lg, border-2, border-red-500 |
| Effects | shadow-xl, opacity-50, transition-all |
| Transforms | scale-110, rotate-45, translate-x-4 |
| Filters | blur-md, grayscale, brightness-110 |
Who This Helps
- Beginners learning Tailwind's utility-first approach
- Developers who want faster lookup than official docs
- Designers exploring what styles are available without writing code
- Teams standardizing on Tailwind class naming conventions
Start typing to search, or browse by category to discover classes you might not know exist.
How it works
This tool combines a curated dataset of Tailwind CSS classes with intelligent search, real-time preview generation, and multiple output formats.
Data Structure
Each class in the reference is stored as a structured object containing:
- Name: The exact Tailwind class (e.g.,
p-4,bg-blue-500) - Description: Human-readable explanation of what the class does
- Category: Grouping for filtering (spacing, typography, effects, etc.)
- CSS Output: The actual CSS properties the class generates
- Visual Type: How the class should be previewed (color, shadow, spacing, etc.)
- Arbitrary Support: Whether the class accepts custom values like
[20px] - Metadata: Additional data like color hex codes, pixel equivalents, or scale values
Search Algorithm
The fuzzy search system scores matches across multiple fields:
- Exact name match — highest priority (score +100)
- Name prefix match —
p-matchesp-4,p-8, etc. (score +50) - Name substring —
shadowmatchesshadow-lg(score +30) - Description matches — search terms found in explanations (score +10)
- Category filtering — prefix syntax like
bg:limits to backgrounds (score +40)
Multi-word queries are split and matched against all fields, with results sorted by cumulative relevance score.
Visual Preview System
Previews are generated using inline styles based on the class's visual type:
| Visual Type | Preview Method |
|---|---|
| Color | Background or text color swatch with hex display |
| Spacing | Sized box showing padding/margin dimensions |
| Shadow | Box with applied box-shadow CSS |
| Border Radius | Element with specific border-radius value |
| Border Width | Element with visible border thickness |
| Opacity | Colored box with opacity applied |
| Blur | Element with filter: blur() applied |
| Scale/Rotate | Transformed box with CSS transform |
| Typography | Text sample with font properties |
For color classes, a dark mode toggle inverts the preview background to check contrast ratios.
Arbitrary Value Validation
When you enter a custom value like 20px or #ff0000, the tool validates against CSS patterns:
- Length units:
px,rem,em,%,vh,vw, etc. - Unitless numbers: for scales, weights, opacity
- CSS functions:
calc(),min(),max(),clamp() - Colors: hex,
rgb(),hsl(), CSS variables - Keywords:
auto,none,inherit, etc.
Invalid values display an error message; valid values update the preview and CSS output instantly.
CSS Output Formats
For any selected class, four formats are available:
| Format | Use Case | Example Output |
|---|---|---|
| Class | Copy the Tailwind class name | p-4 or p-[20px] |
| CSS | Standard CSS for debugging | padding: 1rem; |
| Minified | Production-optimized | padding:1rem |
| @apply | For CSS custom properties | @apply p-4; |
Performance
All operations run client-side:
- Search: O(n) through ~150 classes with early termination
- Filtering: Bitmask checks for category/visual type
- Previews: Pure CSS-in-JS, no DOM manipulation
- No network requests: Complete dataset bundled with the tool
This ensures instant response times even on slower connections.
Examples
Find spacing classes
Search for padding and margin utilities with visual previews
Explore color utilities
Browse background and text color classes with hex values
Test arbitrary values
Experiment with custom values like p-[20px] or w-[100px]
Copy CSS output
Get CSS, minified, or @apply formats for any class
Frequently asked questions
What version of Tailwind CSS does this reference cover?
What version of Tailwind CSS does this reference cover?
This reference covers Tailwind CSS v3.x and v4.x utility classes. The core utility API remains stable across versions, though v4 introduces new features like native CSS nesting and improved performance. Color palettes, spacing scales, and shadow presets follow the default Tailwind configuration.
How do I search for classes in a specific category?
How do I search for classes in a specific category?
Use category prefix syntax in your search: type bg: to search only background classes, text: for typography, flex: for flexbox, etc. You can also use the category filter buttons below the search bar to toggle multiple categories on and off.
What are "arbitrary values" and how do I use them?
What are "arbitrary values" and how do I use them?
Arbitrary values let you use one-off custom values without editing your Tailwind config. Classes that support them show a sparkles icon. Select the class, then enter any value in the "Arbitrary value" field — like 20px, #ff0000, calc(100vh-4rem), or min(50%,300px). The preview and CSS output update instantly if the value is valid CSS.
Why does my arbitrary value show an error?
Why does my arbitrary value show an error?
The validator checks for valid CSS syntax. Common issues:
- Missing units on lengths (use
20px, not20) - Invalid characters like
<,>,{,} - Malformed CSS functions (missing closing parenthesis)
- Values over 100 characters
Use standard CSS values or
calc(),min(),max(),clamp()for complex expressions.
Can I copy the CSS for use without Tailwind?
Can I copy the CSS for use without Tailwind?
Yes. Select any class and click CSS, Minified, or @apply to copy the generated CSS. This is useful for:
- Prototyping without a build step
- Understanding what Tailwind generates
- Migrating away from Tailwind
- Using in environments without Tailwind installed
How do I preview colors in dark mode?
How do I preview colors in dark mode?
Click the moon icon in the preview panel to toggle between light and dark backgrounds. This helps verify contrast ratios and ensures your colors work in both modes. The toggle appears for any class with color visual type (backgrounds and text colors).
What is the difference between grid and list view?
What is the difference between grid and list view?
Grid view shows cards with class name, description, and category badge — best for browsing and discovery. List view condenses to rows with minimal information — best when you know what you are looking for and want to scan quickly. Your preference is not persisted; it resets on page reload.
Why are some Tailwind classes missing?
Why are some Tailwind classes missing?
This reference includes core utility classes (~150) covering the most common use cases. It excludes:
- Plugin-specific classes (forms, typography, aspect-ratio, etc.)
- Arbitrary variants (
md:p-4,hover:bg-red,dark:text-white) - Custom config extensions
- Deprecated v1/v2 classes For complete documentation including plugins and variants, visit the official Tailwind CSS docs.
How are "related classes" determined?
How are "related classes" determined?
Related classes share the same base prefix and category. For example, selecting p-4 shows p-1, p-2, p-8, px-4, py-4, etc. This helps you discover the full scale of a utility without searching repeatedly.
Can I use this offline?
Can I use this offline?
Yes. The entire class database is bundled with the tool — no network requests are made after initial load. You can bookmark the page and use it without an internet connection. Search, previews, and CSS generation all work client-side.
What browsers are supported?
What browsers are supported?
This tool requires a modern browser with ES2020+ support:
- Chrome/Edge 80+
- Firefox 75+
- Safari 13.1+
- iOS Safari 13.4+ Older browsers may have degraded search performance or missing preview features.
How do I report incorrect CSS output?
How do I report incorrect CSS output?
The CSS shown is approximated from Tailwind's defaults. Your actual build output may differ if you have:
- Custom
tailwind.config.jsvalues - Plugins that modify utilities
- CSS layers or post-processing For bugs in this tool's output, check the official Tailwind documentation first, then verify against your actual build.
Related tools
More utilities you might find handy.
.env File Generator
Quickly generate clean, properly-quoted .env files from key-value pairs — no more quoting errors or broken deployments.
.htaccess Redirect Builder
Generate error-free Apache .htaccess code for 301 redirects, HTTPS enforcement, and canonical URL routing.
ASCII Converter – Text to ASCII, Hex, Binary & Back
Convert text to ASCII codes and decode back in decimal, hex, binary, or octal — live, private, and 100% browser-based.