Tools
Tailwind CSS cheat sheet
A quick reference to Tailwind CSS classes and the CSS they produce.
sm:e.g. sm:flexmd:e.g. md:grid-cols-2lg:e.g. lg:px-8xl:e.g. xl:max-w-6xl2xl:e.g. 2xl:text-lgblockinline-blockinlineflexinline-flexgridinline-gridhiddencontentsstaticfixedabsoluterelativestickyinset-0inset-x-0inset-y-0top-0right-0bottom-0left-0flex-rowflex-colflex-wrapflex-nowrapflex-1flex-autoflex-nonegrowgrow-0shrinkshrink-0grid-cols-1grid-cols-2grid-cols-3grid-cols-4grid-cols-12col-span-1col-span-2col-span-fullgrid-rows-1grid-rows-2justify-startjustify-centerjustify-endjustify-betweenjustify-aroundjustify-evenlyitems-startitems-centeritems-enditems-baselineitems-stretchself-autoself-startself-centerself-endp-0p-1p-2p-4p-6p-8px-*py-*pt/pr/pb/pl-*m-0m-1m-2m-4m-auto-m-1mx-autogap-0gap-1gap-2gap-4gap-x-*gap-y-*w-0w-1w-4w-fullw-screenw-autow-1/2w-1/3w-fitmin-w-0min-w-fullmax-w-smmax-w-mdmax-w-lgmax-w-xlmax-w-2xlmax-w-fullmax-w-screen-smmax-w-screen-mdmax-w-screen-lgh-0h-4h-fullh-screenh-automin-h-0min-h-fullmin-h-screensize-4size-6size-fulltext-xstext-smtext-basetext-lgtext-xltext-2xltext-3xltext-4xlfont-thinfont-lightfont-normalfont-mediumfont-semiboldfont-boldfont-sansfont-seriffont-monoitalicnot-italicleading-noneleading-tightleading-normalleading-relaxedleading-loosetracking-tighttracking-normaltracking-widetext-lefttext-centertext-righttext-justifyuppercaselowercasecapitalizenormal-caseunderlineline-throughno-underlinetruncatetext-ellipsistext-clipwhitespace-normalwhitespace-nowrapwhitespace-prebreak-normalbreak-wordsbreak-allline-clamp-1line-clamp-2line-clamp-3bg-transparentbg-currentbg-whitebg-blackbg-slate-500bg-[#hex]e.g. bg-[#1da1f2]bg-coverbg-containbg-centerbg-no-repeatbg-repeatbg-fixedbg-gradient-to-rbg-gradient-to-bfrom-blue-500via-purple-500to-pink-500borderborder-0border-2border-4border-tborder-rborder-bborder-lborder-solidborder-dashedborder-dottedborder-noneroundedrounded-mdrounded-lgrounded-xlrounded-2xlrounded-fullrounded-nonerounded-t-lgdivide-xdivide-yshadow-smshadowshadow-mdshadow-lgshadow-xlshadow-2xlshadow-innershadow-noneopacity-0opacity-50opacity-100blurblur-smblur-lgblur-nonebackdrop-blurbackdrop-blur-smtransitiontransition-nonetransition-colorstransition-opacitytransition-transformduration-75duration-150duration-300duration-500ease-linearease-inease-outease-in-outdelay-150delay-300animate-spinanimate-pinganimate-pulseanimate-bouncescale-0scale-50scale-100scale-150rotate-0rotate-45rotate-90rotate-180-rotate-45translate-x-0translate-x-4translate-x-full-translate-x-4translate-y-4skew-x-3skew-y-3origin-centerorigin-topcursor-pointercursor-defaultcursor-not-allowedcursor-waitcursor-grabpointer-events-nonepointer-events-autoselect-noneselect-textselect-allresizeresize-noneresize-xresize-yscroll-smoothscroll-autohover:e.g. hover:bg-blue-600focus:e.g. focus:ring-2focus-visible:e.g. focus-visible:outline-noneactive:e.g. active:bg-blue-700disabled:e.g. disabled:opacity-50first:e.g. first:mt-0last:e.g. last:mb-0odd:e.g. odd:bg-gray-100even:e.g. even:bg-whitegroup-hover:e.g. group-hover:visiblepeer-focus:e.g. peer-focus:ringdark:e.g. dark:bg-gray-900motion-safe:e.g. motion-safe:animate-spinmotion-reduce:e.g. motion-reduce:animate-noneoverflow-autooverflow-hiddenoverflow-visibleoverflow-scrolloverflow-x-autooverflow-y-autooverflow-x-hiddenoverflow-y-hiddenz-0z-10z-20z-30z-40z-50z-auto-z-10w-[200px], text-[#1da1f2], grid-cols-[1fr_2fr]About this tool
Even if you use Tailwind every day, it is easy to forget whether you wanted justify-between or items-center, how big p-6 is, or what truncate actually does. This cheat sheet collects the most common classes alongside the CSS they generate, grouped into sections: breakpoints, display, position, flexbox, grid, alignment, spacing, sizing, typography, backgrounds, borders, effects, transitions, transforms, interactivity and states.
Type in the search box and the list filters instantly by class name, CSS property or example, so you can look up “gap”, “flex-direction” or “hover”. The section bar lets you show just one section, and you can collapse or expand each block by clicking its heading. The button on each row copies the class to your clipboard, ready to paste into your HTML or JSX.
It is a static reference that runs in your browser with no calls to outside services. It covers a selection of the most frequently used classes rather than the full documentation, and the values reflect Tailwind’s default configuration; if your project customises the theme (colours, spacing, breakpoints), your actual values may differ. For one-off cases, use arbitrary values in square brackets.
Frequently asked questions
How big is each spacing unit in Tailwind?
By default each unit is 0.25rem, which is 4px with a 16px base font size. So p-4 is 1rem (16px) and gap-2 is 0.5rem (8px).
How do I use a value that isn’t on the scale?
Use arbitrary values in square brackets, for example w-[200px], text-[#1da1f2] or grid-cols-[1fr_2fr]. Spaces inside the value are written as underscores.
What do sm:, md: and lg: mean?
They are breakpoint prefixes that apply a class from a minimum width upwards: 640, 768 and 1024px by default. Tailwind is mobile-first, so unprefixed classes apply at every size.
Does it cover both Tailwind 3 and Tailwind 4?
Most classes here exist in both versions. A few were renamed or changed value in v4, such as gradients and some shadows, so check the docs for your version if in doubt.