Tailwind Cheat Sheet

Tailwind Cheat Sheet

Other Tools

Quick reference for Tailwind classes

ClassCSS
sm:e.g. sm:flex@media (min-width: 640px)
md:e.g. md:grid-cols-2@media (min-width: 768px)
lg:e.g. lg:px-8@media (min-width: 1024px)
xl:e.g. xl:max-w-6xl@media (min-width: 1280px)
2xl:e.g. 2xl:text-lg@media (min-width: 1536px)
ClassCSS
blockdisplay: block
inline-blockdisplay: inline-block
inlinedisplay: inline
flexdisplay: flex
inline-flexdisplay: inline-flex
griddisplay: grid
inline-griddisplay: inline-grid
hiddendisplay: none
contentsdisplay: contents
ClassCSS
staticposition: static
fixedposition: fixed
absoluteposition: absolute
relativeposition: relative
stickyposition: sticky
inset-0inset: 0
inset-x-0left: 0; right: 0
inset-y-0top: 0; bottom: 0
top-0top: 0
right-0right: 0
bottom-0bottom: 0
left-0left: 0
ClassCSS
flex-rowflex-direction: row
flex-colflex-direction: column
flex-wrapflex-wrap: wrap
flex-nowrapflex-wrap: nowrap
flex-1flex: 1 1 0%
flex-autoflex: 1 1 auto
flex-noneflex: none
growflex-grow: 1
grow-0flex-grow: 0
shrinkflex-shrink: 1
shrink-0flex-shrink: 0
ClassCSS
grid-cols-1grid-template-columns: repeat(1, minmax(0, 1fr))
grid-cols-2grid-template-columns: repeat(2, minmax(0, 1fr))
grid-cols-3grid-template-columns: repeat(3, minmax(0, 1fr))
grid-cols-4grid-template-columns: repeat(4, minmax(0, 1fr))
grid-cols-12grid-template-columns: repeat(12, minmax(0, 1fr))
col-span-1grid-column: span 1 / span 1
col-span-2grid-column: span 2 / span 2
col-span-fullgrid-column: 1 / -1
grid-rows-1grid-template-rows: repeat(1, minmax(0, 1fr))
grid-rows-2grid-template-rows: repeat(2, minmax(0, 1fr))
ClassCSS
justify-startjustify-content: flex-start
justify-centerjustify-content: center
justify-endjustify-content: flex-end
justify-betweenjustify-content: space-between
justify-aroundjustify-content: space-around
justify-evenlyjustify-content: space-evenly
items-startalign-items: flex-start
items-centeralign-items: center
items-endalign-items: flex-end
items-baselinealign-items: baseline
items-stretchalign-items: stretch
self-autoalign-self: auto
self-startalign-self: flex-start
self-centeralign-self: center
self-endalign-self: flex-end
ClassCSS
p-0padding: 0
p-1padding: 0.25rem (4px)
p-2padding: 0.5rem (8px)
p-4padding: 1rem (16px)
p-6padding: 1.5rem (24px)
p-8padding: 2rem (32px)
px-*padding-left & padding-right
py-*padding-top & padding-bottom
pt/pr/pb/pl-*padding-[side]
m-0margin: 0
m-1margin: 0.25rem (4px)
m-2margin: 0.5rem (8px)
m-4margin: 1rem (16px)
m-automargin: auto
-m-1margin: -0.25rem
mx-automargin-left: auto; margin-right: auto
gap-0gap: 0
gap-1gap: 0.25rem (4px)
gap-2gap: 0.5rem (8px)
gap-4gap: 1rem (16px)
gap-x-*column-gap
gap-y-*row-gap
ClassCSS
w-0width: 0
w-1width: 0.25rem (4px)
w-4width: 1rem (16px)
w-fullwidth: 100%
w-screenwidth: 100vw
w-autowidth: auto
w-1/2width: 50%
w-1/3width: 33.333%
w-fitwidth: fit-content
min-w-0min-width: 0
min-w-fullmin-width: 100%
max-w-smmax-width: 24rem (384px)
max-w-mdmax-width: 28rem (448px)
max-w-lgmax-width: 32rem (512px)
max-w-xlmax-width: 36rem (576px)
max-w-2xlmax-width: 42rem (672px)
max-w-fullmax-width: 100%
max-w-screen-smmax-width: 640px
max-w-screen-mdmax-width: 768px
max-w-screen-lgmax-width: 1024px
h-0height: 0
h-4height: 1rem (16px)
h-fullheight: 100%
h-screenheight: 100vh
h-autoheight: auto
min-h-0min-height: 0
min-h-fullmin-height: 100%
min-h-screenmin-height: 100vh
size-4width: 1rem; height: 1rem
size-6width: 1.5rem; height: 1.5rem
size-fullwidth: 100%; height: 100%
ClassCSS
text-xsfont-size: 0.75rem (12px)
text-smfont-size: 0.875rem (14px)
text-basefont-size: 1rem (16px)
text-lgfont-size: 1.125rem (18px)
text-xlfont-size: 1.25rem (20px)
text-2xlfont-size: 1.5rem (24px)
text-3xlfont-size: 1.875rem (30px)
text-4xlfont-size: 2.25rem (36px)
font-thinfont-weight: 100
font-lightfont-weight: 300
font-normalfont-weight: 400
font-mediumfont-weight: 500
font-semiboldfont-weight: 600
font-boldfont-weight: 700
font-sansfont-family: ui-sans-serif, system-ui, sans-serif
font-seriffont-family: ui-serif, Georgia, serif
font-monofont-family: ui-monospace, monospace
italicfont-style: italic
not-italicfont-style: normal
leading-noneline-height: 1
leading-tightline-height: 1.25
leading-normalline-height: 1.5
leading-relaxedline-height: 1.625
leading-looseline-height: 2
tracking-tightletter-spacing: -0.025em
tracking-normalletter-spacing: 0
tracking-wideletter-spacing: 0.025em
ClassCSS
text-lefttext-align: left
text-centertext-align: center
text-righttext-align: right
text-justifytext-align: justify
uppercasetext-transform: uppercase
lowercasetext-transform: lowercase
capitalizetext-transform: capitalize
normal-casetext-transform: none
underlinetext-decoration: underline
line-throughtext-decoration: line-through
no-underlinetext-decoration: none
truncateoverflow: hidden; text-overflow: ellipsis; white-space: nowrap
text-ellipsistext-overflow: ellipsis
text-cliptext-overflow: clip
whitespace-normalwhite-space: normal
whitespace-nowrapwhite-space: nowrap
whitespace-prewhite-space: pre
break-normalword-break: normal
break-wordsword-break: break-word
break-allword-break: break-all
line-clamp-1-webkit-line-clamp: 1
line-clamp-2-webkit-line-clamp: 2
line-clamp-3-webkit-line-clamp: 3
ClassCSS
bg-transparentbackground-color: transparent
bg-currentbackground-color: currentColor
bg-whitebackground-color: #fff
bg-blackbackground-color: #000
bg-slate-500background-color: #64748b
bg-[#hex]e.g. bg-[#1da1f2]background-color: #hex
bg-coverbackground-size: cover
bg-containbackground-size: contain
bg-centerbackground-position: center
bg-no-repeatbackground-repeat: no-repeat
bg-repeatbackground-repeat: repeat
bg-fixedbackground-attachment: fixed
bg-gradient-to-rbackground-image: linear-gradient(to right, ...)
bg-gradient-to-bbackground-image: linear-gradient(to bottom, ...)
from-blue-500gradient start color
via-purple-500gradient middle color
to-pink-500gradient end color
ClassCSS
borderborder-width: 1px
border-0border-width: 0
border-2border-width: 2px
border-4border-width: 4px
border-tborder-top-width: 1px
border-rborder-right-width: 1px
border-bborder-bottom-width: 1px
border-lborder-left-width: 1px
border-solidborder-style: solid
border-dashedborder-style: dashed
border-dottedborder-style: dotted
border-noneborder-style: none
roundedborder-radius: 0.25rem (4px)
rounded-mdborder-radius: 0.375rem (6px)
rounded-lgborder-radius: 0.5rem (8px)
rounded-xlborder-radius: 0.75rem (12px)
rounded-2xlborder-radius: 1rem (16px)
rounded-fullborder-radius: 9999px
rounded-noneborder-radius: 0
rounded-t-lgborder-top-left/right-radius: 0.5rem
divide-xborder between horizontal children
divide-yborder between vertical children
ClassCSS
shadow-smbox-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05)
shadowbox-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1)
shadow-mdbox-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1)
shadow-lgbox-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1)
shadow-xlbox-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1)
shadow-2xlbox-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25)
shadow-innerbox-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05)
shadow-nonebox-shadow: none
opacity-0opacity: 0
opacity-50opacity: 0.5
opacity-100opacity: 1
blurfilter: blur(8px)
blur-smfilter: blur(4px)
blur-lgfilter: blur(16px)
blur-nonefilter: blur(0)
backdrop-blurbackdrop-filter: blur(8px)
backdrop-blur-smbackdrop-filter: blur(4px)
ClassCSS
transitiontransition: all 150ms ease
transition-nonetransition: none
transition-colorstransition: color, background-color, border-color
transition-opacitytransition: opacity 150ms
transition-transformtransition: transform 150ms
duration-75transition-duration: 75ms
duration-150transition-duration: 150ms
duration-300transition-duration: 300ms
duration-500transition-duration: 500ms
ease-lineartransition-timing-function: linear
ease-intransition-timing-function: ease-in
ease-outtransition-timing-function: ease-out
ease-in-outtransition-timing-function: ease-in-out
delay-150transition-delay: 150ms
delay-300transition-delay: 300ms
animate-spinanimation: spin 1s linear infinite
animate-pinganimation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite
animate-pulseanimation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite
animate-bounceanimation: bounce 1s infinite
ClassCSS
scale-0transform: scale(0)
scale-50transform: scale(0.5)
scale-100transform: scale(1)
scale-150transform: scale(1.5)
rotate-0transform: rotate(0deg)
rotate-45transform: rotate(45deg)
rotate-90transform: rotate(90deg)
rotate-180transform: rotate(180deg)
-rotate-45transform: rotate(-45deg)
translate-x-0transform: translateX(0)
translate-x-4transform: translateX(1rem)
translate-x-fulltransform: translateX(100%)
-translate-x-4transform: translateX(-1rem)
translate-y-4transform: translateY(1rem)
skew-x-3transform: skewX(3deg)
skew-y-3transform: skewY(3deg)
origin-centertransform-origin: center
origin-toptransform-origin: top
ClassCSS
cursor-pointercursor: pointer
cursor-defaultcursor: default
cursor-not-allowedcursor: not-allowed
cursor-waitcursor: wait
cursor-grabcursor: grab
pointer-events-nonepointer-events: none
pointer-events-autopointer-events: auto
select-noneuser-select: none
select-textuser-select: text
select-alluser-select: all
resizeresize: both
resize-noneresize: none
resize-xresize: horizontal
resize-yresize: vertical
scroll-smoothscroll-behavior: smooth
scroll-autoscroll-behavior: auto
ClassCSS
hover:e.g. hover:bg-blue-600on mouse hover
focus:e.g. focus:ring-2on focus
focus-visible:e.g. focus-visible:outline-noneon keyboard focus
active:e.g. active:bg-blue-700on active/pressed
disabled:e.g. disabled:opacity-50when disabled
first:e.g. first:mt-0first child
last:e.g. last:mb-0last child
odd:e.g. odd:bg-gray-100odd children
even:e.g. even:bg-whiteeven children
group-hover:e.g. group-hover:visiblewhen parent .group is hovered
peer-focus:e.g. peer-focus:ringwhen sibling .peer is focused
dark:e.g. dark:bg-gray-900dark mode
motion-safe:e.g. motion-safe:animate-spinif user allows motion
motion-reduce:e.g. motion-reduce:animate-noneif user prefers reduced motion
ClassCSS
overflow-autooverflow: auto
overflow-hiddenoverflow: hidden
overflow-visibleoverflow: visible
overflow-scrolloverflow: scroll
overflow-x-autooverflow-x: auto
overflow-y-autooverflow-y: auto
overflow-x-hiddenoverflow-x: hidden
overflow-y-hiddenoverflow-y: hidden
z-0z-index: 0
z-10z-index: 10
z-20z-index: 20
z-30z-index: 30
z-40z-index: 40
z-50z-index: 50
z-autoz-index: auto
-z-10z-index: -10
Tip: Use arbitrary values with square brackets:w-[200px],text-[#1da1f2],grid-cols-[1fr_2fr]