Tailwind Cheat Sheet

Search every Tailwind utility by name or meaning, browse by category, copy the class and see a usage example — with responsive and state prefixes explained.

Privacy secured — processed and purged

126 classes shown

Layout

  • block

    Display as a block element

  • inline-block

    Inline but respects width and height

  • flex

    Lay children out with flexbox

  • grid

    Lay children out with CSS grid

  • hidden

    Remove from layout entirely

  • relative

    Position relative to itself, enabling absolute children

  • absolute

    Position against the nearest positioned ancestor

  • fixed

    Position against the viewport

  • sticky

    Stay in place while its container scrolls

    Example: sticky top-0 z-10

  • inset-0

    Pin to all four edges — the full-cover overlay

  • top-0 / bottom-0 / left-0 / right-0

    Pin to one edge

  • z-10 / z-50

    Stacking order above siblings

  • container

    Center content with responsive max width

  • columns-2

    Flow text into two CSS columns

  • aspect-video

    Hold a 16:9 box as it resizes

  • overflow-hidden

    Clip anything that escapes the box

  • overflow-auto

    Scroll inside the box only when needed

Flexbox & Grid

  • flex-row / flex-col

    Main axis: horizontal or vertical

  • flex-wrap

    Let children wrap onto new lines

  • flex-1

    Grow to fill the remaining space

  • flex-none

    Never grow or shrink

  • items-center

    Align children on the cross axis

  • items-start / items-end

    Align children to the cross-axis start or end

  • justify-center

    Center children on the main axis

  • justify-between

    Push children to both ends

  • justify-end

    Push children to the main-axis end

  • gap-4

    Space between children — works in flex and grid

  • grid-cols-3

    Three equal columns

  • col-span-2

    Let an item cover two columns

  • grid-rows-2

    Two explicit rows

  • place-items-center

    Center grid items on both axes

  • space-y-3

    Vertical rhythm between stacked children

  • order-1 / order-last

    Reorder children without touching the markup

Spacing

  • p-4

    Padding on all sides (1rem)

  • px-6 / py-3

    Horizontal or vertical padding only

  • pt-2 / pb-8 / pl-1 / pr-0

    Padding on one edge

  • m-0

    Margin on all sides

  • mx-auto

    Centre a fixed-width block horizontally

  • mt-4 / mb-2

    Margin on one edge

  • -mt-2

    Negative margin pulls toward the neighbour

  • gap-x-4 / gap-y-2

    Separate horizontal and vertical gaps

  • space-x-2

    Horizontal rhythm between inline children

Sizing

  • w-full

    Full width of the parent

  • w-1/2

    Half width

  • w-screen

    Viewport width

  • w-fit / w-max

    Shrink-wrap to content

  • h-screen

    Viewport height

  • min-h-screen

    At least a full viewport tall

  • max-w-md

    Cap the width at 28rem

  • max-w-prose

    Comfortable reading measure (~65ch)

  • size-10

    Width and height together (Tailwind 3.4+)

  • w-[320px]

    Arbitrary value when no scale step fits

Typography

  • text-sm / text-lg

    Font size with matching line height

  • font-bold

    Font weight

  • italic

    Italic text

  • uppercase / lowercase / capitalize

    Letter case transform

  • tracking-wide

    Letter spacing

  • leading-relaxed

    Line height

  • text-center / text-left / text-right

    Horizontal alignment

  • truncate

    One line, clipped with an ellipsis

  • line-clamp-3

    Clamp to three lines with an ellipsis

  • break-words

    Break long words instead of overflowing

  • font-mono / font-sans / font-serif

    Font family

  • text-balance

    Balance headline line lengths (3.4+)

  • prose

    Typography plugin styling for rich HTML

Backgrounds

  • bg-slate-900

    Background colour from the palette

  • bg-[#0A0A0A]

    Arbitrary background colour

  • bg-transparent

    No fill

  • bg-gradient-to-r

    Linear gradient to the right

    Example: bg-gradient-to-r from-lime-300 to-emerald-500

  • bg-cover / bg-contain

    How a background image fills the box

  • bg-center

    Background image position

  • bg-no-repeat

    Draw the background image once

Borders

  • border

    1px border in the default colour

  • border-2

    Thicker border

  • border-t

    Top edge only

  • border-slate-200

    Border colour

  • rounded-lg

    Corner radius

  • rounded-full

    Pill / circle

  • divide-y

    Borders between stacked children

  • ring-2 / ring-offset-2

    Outline ring, handy for focus states

  • outline-none

    Remove the default focus outline (pair it with a ring)

Effects

  • shadow-sm / shadow-lg

    Box shadow

  • shadow-none

    Remove the shadow

  • opacity-60

    Element transparency

  • mix-blend-multiply

    Blend mode with the backdrop

  • backdrop-blur-md

    Blur whatever sits behind the element

  • blur-sm

    Blur the element itself

Filters

  • grayscale

    Remove colour

  • invert

    Invert colours

  • sepia

    Sepia tone

  • brightness-110

    Brighten

  • contrast-125

    Increase contrast

  • saturate-150

    Increase saturation

  • drop-shadow-lg

    Shadow that follows the shape's alpha

Transitions

  • transition

    Animate common properties on change

  • transition-colors

    Animate colour changes only

  • duration-200

    Transition length in milliseconds

  • ease-in-out

    Timing curve

  • delay-100

    Wait before the transition starts

  • animate-spin

    Continuous spin

  • animate-pulse

    Fade pulse

  • animate-bounce

    Bounce

Transforms

  • scale-105

    Scale up on both axes

  • rotate-45

    Rotate

  • translate-x-2

    Shift along an axis

  • origin-top-left

    Set the transform origin

  • transform-gpu

    Force GPU compositing

Interactivity

  • cursor-pointer

    Hand cursor

  • select-none

    Prevent text selection

  • pointer-events-none

    Let clicks pass through

  • resize-y

    Native resize handle

  • scroll-smooth

    Animate scrolls inside the element

  • sr-only

    Visually hidden, still read by screen readers

  • accent-lime-400

    Colour of native checkboxes and ranges

Responsive & State

  • sm: / md: / lg: / xl: / 2xl:

    Apply from that breakpoint upward

    Example: md:grid-cols-2

  • max-md:

    Apply only below a breakpoint

    Example: max-md:hidden

  • hover:

    While the pointer is over the element

    Example: hover:bg-slate-800

  • focus: / focus-visible:

    On keyboard or input focus

    Example: focus-visible:ring-2

  • active:

    While pressed

  • disabled:

    When the control is disabled

  • group / group-hover:

    Style children from a parent's state

    Example: group-hover:opacity-100

  • peer / peer-checked:

    Style a sibling from an input's state

  • dark:

    When dark mode is active

    Example: dark:bg-slate-950

  • motion-reduce:

    Respect the reduced-motion preference

  • aria-expanded:

    Style from an ARIA state

  • *:

    Target direct children (3.4+)

Spacing scale

Classrempx
p-00rem0
p-0.50.125rem2
p-10.25rem4
p-20.5rem8
p-30.75rem12
p-41rem16
p-61.5rem24
p-82rem32
p-123rem48
p-164rem64
p-246rem96

One step is 0.25rem (4px) — spacing utilities share this scale, so p-4 is 1rem.

Need a brand colour scale?Turn one colour into a 50–950 Tailwind scale.

How to use the Tailwind cheat sheet

  1. 1Search for a class name or what you want to do.
  2. 2Narrow the list with the category chips.
  3. 3Copy any class with one click.
  4. 4Need a custom scale? Continue in the Tailwind Shade Generator.

About this tool

Every entry is a utility from the default Tailwind v3 scale, grouped by what it does: layout, flexbox and grid, spacing, sizing, typography, backgrounds, borders, effects, filters, transitions, transforms, interactivity, and the responsive/state prefixes. Responsive variants apply from a breakpoint upward (md:), while max-md: applies only below it — the pair that trips people up most often.

FAQ

Is this tool free?

Yes — every tool is free, with no signup and no subscription.

Are my files uploaded?

No. Everything is processed in your browser and nothing is stored.

Does it work on a phone?

Yes. The layout adapts to small screens and every result downloads normally.

Advertisement space — reserved

Related tools