Tailwind CSS Quick Reference

Search utility classes by name or CSS property. Click any class to copy it.

Showing 187 of 187 classesClick any class to copy
Layout(25)
container
max-width: breakpoint width
Sets max-width based on current breakpoint
block
display: block
Sets display to block
inline-block
display: inline-block
Sets display to inline-block
inline
display: inline
Sets display to inline
flex
display: flex
Sets display to flex
inline-flex
display: inline-flex
Sets display to inline-flex
grid
display: grid
Sets display to grid
hidden
display: none
Hides element (display none)
overflow-auto
overflow: auto
Adds scrollbar only when needed
overflow-hidden
overflow: hidden
Clips overflowing content
overflow-scroll
overflow: scroll
Always shows scrollbar
overflow-x-auto
overflow-x: auto
Horizontal scrollbar when needed
overflow-y-auto
overflow-y: auto
Vertical scrollbar when needed
relative
position: relative
Positions element relative to normal flow
absolute
position: absolute
Removes from flow, positions to nearest positioned ancestor
fixed
position: fixed
Positions relative to viewport
sticky
position: sticky
Sticks to nearest scroll container
top-0
top: 0px
Pins element to top edge
right-0
right: 0px
Pins element to right edge
bottom-0
bottom: 0px
Pins element to bottom edge
left-0
left: 0px
Pins element to left edge
inset-0
top: 0; right: 0; bottom: 0; left: 0
Pins all edges to 0 (full cover)
z-10
z-index: 10
Sets stacking order to 10
z-20
z-index: 20
Sets stacking order to 20
z-50
z-index: 50
Sets stacking order to 50
Flexbox & Grid(24)
flex-row
flex-direction: row
Main axis goes left to right
flex-col
flex-direction: column
Main axis goes top to bottom
flex-wrap
flex-wrap: wrap
Items wrap to next line when overflow
flex-nowrap
flex-wrap: nowrap
Items never wrap
justify-start
justify-content: flex-start
Items packed to start of main axis
justify-center
justify-content: center
Items centered on main axis
justify-end
justify-content: flex-end
Items packed to end of main axis
justify-between
justify-content: space-between
Equal space between items
justify-around
justify-content: space-around
Equal space around items
justify-evenly
justify-content: space-evenly
Equal space between and around items
items-start
align-items: flex-start
Align items to start of cross axis
items-center
align-items: center
Align items to center of cross axis
items-end
align-items: flex-end
Align items to end of cross axis
items-stretch
align-items: stretch
Stretch items to fill cross axis
flex-1
flex: 1 1 0%
Grow and shrink as needed, ignoring initial size
flex-auto
flex: 1 1 auto
Grow and shrink based on initial size
flex-none
flex: none
Prevent item from growing or shrinking
flex-grow
flex-grow: 1
Allow item to grow to fill available space
flex-shrink
flex-shrink: 1
Allow item to shrink when needed
grid-cols-1
grid-template-columns: repeat(1, minmax(0, 1fr))
1-column grid
grid-cols-2
grid-template-columns: repeat(2, minmax(0, 1fr))
2-column grid
grid-cols-3
grid-template-columns: repeat(3, minmax(0, 1fr))
3-column grid
col-span-2
grid-column: span 2 / span 2
Span 2 grid columns
col-span-full
grid-column: 1 / -1
Span all grid columns
Spacing(29)
p-0
padding: 0px
Remove all padding
p-1
padding: 0.25rem
4px padding all sides
p-2
padding: 0.5rem
8px padding all sides
p-4
padding: 1rem
16px padding all sides
p-6
padding: 1.5rem
24px padding all sides
p-8
padding: 2rem
32px padding all sides
px-4
padding-left: 1rem; padding-right: 1rem
16px horizontal padding
py-4
padding-top: 1rem; padding-bottom: 1rem
16px vertical padding
pt-4
padding-top: 1rem
16px top padding
pr-4
padding-right: 1rem
16px right padding
pb-4
padding-bottom: 1rem
16px bottom padding
pl-4
padding-left: 1rem
16px left padding
m-0
margin: 0px
Remove all margin
m-1
margin: 0.25rem
4px margin all sides
m-2
margin: 0.5rem
8px margin all sides
m-4
margin: 1rem
16px margin all sides
mx-auto
margin-left: auto; margin-right: auto
Center element horizontally
my-auto
margin-top: auto; margin-bottom: auto
Center element vertically
mt-4
margin-top: 1rem
16px top margin
mb-4
margin-bottom: 1rem
16px bottom margin
space-x-2
> * + * { margin-left: 0.5rem }
8px horizontal gap between children
space-x-4
> * + * { margin-left: 1rem }
16px horizontal gap between children
space-y-2
> * + * { margin-top: 0.5rem }
8px vertical gap between children
space-y-4
> * + * { margin-top: 1rem }
16px vertical gap between children
gap-1
gap: 0.25rem
4px gap between grid/flex items
gap-2
gap: 0.5rem
8px gap between grid/flex items
gap-4
gap: 1rem
16px gap between grid/flex items
gap-6
gap: 1.5rem
24px gap between grid/flex items
gap-8
gap: 2rem
32px gap between grid/flex items
Sizing(18)
w-full
width: 100%
Full width of parent
w-screen
width: 100vw
Full viewport width
w-auto
width: auto
Browser-determined width
w-1/2
width: 50%
Half the parent width
w-1/3
width: 33.333333%
One third the parent width
w-2/3
width: 66.666667%
Two thirds the parent width
w-1/4
width: 25%
One quarter the parent width
w-3/4
width: 75%
Three quarters the parent width
max-w-xs
max-width: 20rem
Max width 320px
max-w-sm
max-width: 24rem
Max width 384px
max-w-md
max-width: 28rem
Max width 448px
max-w-lg
max-width: 32rem
Max width 512px
max-w-xl
max-width: 36rem
Max width 576px
max-w-2xl
max-width: 42rem
Max width 672px
max-w-full
max-width: 100%
Max width is 100% of parent
h-full
height: 100%
Full height of parent
h-screen
height: 100vh
Full viewport height
min-h-screen
min-height: 100vh
Minimum full viewport height
Typography(28)
text-xs
font-size: 0.75rem; line-height: 1rem
Extra small text (12px)
text-sm
font-size: 0.875rem; line-height: 1.25rem
Small text (14px)
text-base
font-size: 1rem; line-height: 1.5rem
Base text size (16px)
text-lg
font-size: 1.125rem; line-height: 1.75rem
Large text (18px)
text-xl
font-size: 1.25rem; line-height: 1.75rem
Extra large text (20px)
text-2xl
font-size: 1.5rem; line-height: 2rem
2x large text (24px)
text-3xl
font-size: 1.875rem; line-height: 2.25rem
3x large text (30px)
text-4xl
font-size: 2.25rem; line-height: 2.5rem
4x large text (36px)
font-normal
font-weight: 400
Normal font weight
font-medium
font-weight: 500
Medium font weight
font-semibold
font-weight: 600
Semi-bold font weight
font-bold
font-weight: 700
Bold font weight
leading-none
line-height: 1
No extra line height
leading-tight
line-height: 1.25
Tight line height
leading-normal
line-height: 1.5
Normal line height
leading-relaxed
line-height: 1.625
Relaxed line height
tracking-tight
letter-spacing: -0.05em
Tighter letter spacing
tracking-normal
letter-spacing: 0em
Normal letter spacing
tracking-wide
letter-spacing: 0.025em
Wider letter spacing
text-left
text-align: left
Left-align text
text-center
text-align: center
Center-align text
text-right
text-align: right
Right-align text
truncate
overflow: hidden; text-overflow: ellipsis; white-space: nowrap
Truncate text with ellipsis
uppercase
text-transform: uppercase
Transform text to uppercase
lowercase
text-transform: lowercase
Transform text to lowercase
capitalize
text-transform: capitalize
Capitalize first letter of each word
italic
font-style: italic
Italic text
not-italic
font-style: normal
Remove italic style
Colors(16)
text-white
color: rgb(255 255 255)
White text color
text-black
color: rgb(0 0 0)
Black text color
text-gray-500
color: rgb(107 114 128)
Gray text (medium)
text-gray-700
color: rgb(55 65 81)
Dark gray text
text-blue-500
color: rgb(59 130 246)
Blue text
text-blue-600
color: rgb(37 99 235)
Darker blue text
text-red-500
color: rgb(239 68 68)
Red text
text-green-500
color: rgb(34 197 94)
Green text
bg-white
background-color: rgb(255 255 255)
White background
bg-black
background-color: rgb(0 0 0)
Black background
bg-gray-100
background-color: rgb(243 244 246)
Very light gray background
bg-gray-900
background-color: rgb(17 24 39)
Very dark gray background
bg-blue-500
background-color: rgb(59 130 246)
Blue background
bg-red-500
background-color: rgb(239 68 68)
Red background
bg-green-500
background-color: rgb(34 197 94)
Green background
bg-transparent
background-color: transparent
Transparent background
Borders(15)
border
border-width: 1px
1px border on all sides
border-2
border-width: 2px
2px border on all sides
border-0
border-width: 0px
Remove border
border-t
border-top-width: 1px
1px top border only
border-b
border-bottom-width: 1px
1px bottom border only
border-solid
border-style: solid
Solid border style
border-dashed
border-style: dashed
Dashed border style
rounded
border-radius: 0.25rem
Small border radius (4px)
rounded-md
border-radius: 0.375rem
Medium border radius (6px)
rounded-lg
border-radius: 0.5rem
Large border radius (8px)
rounded-xl
border-radius: 0.75rem
Extra large border radius (12px)
rounded-2xl
border-radius: 1rem
2x large border radius (16px)
rounded-full
border-radius: 9999px
Fully rounded (pill / circle)
divide-x
border-right-width: 0; border-left-width: 1px (between)
Adds vertical divider between children
divide-y
border-top-width: 0; border-bottom-width: 1px (between)
Adds horizontal divider between children
Effects(13)
shadow-sm
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05)
Small box shadow
shadow
box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1)
Default box shadow
shadow-md
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1)
Medium box shadow
shadow-lg
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1)
Large box shadow
shadow-xl
box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1)
Extra large box shadow
shadow-none
box-shadow: 0 0 #0000
Remove box shadow
opacity-0
opacity: 0
Fully transparent
opacity-50
opacity: 0.5
Half transparent
opacity-100
opacity: 1
Fully opaque
ring
box-shadow: 0 0 0 3px var(--tw-ring-color)
Adds ring (focus outline effect)
blur
filter: blur(8px)
Blurs element (8px)
blur-sm
filter: blur(4px)
Slightly blurs element (4px)
backdrop-blur
backdrop-filter: blur(8px)
Blurs content behind element
Transforms(9)
scale-100
transform: scale(1)
No scale transformation
scale-95
transform: scale(0.95)
Scale down to 95%
scale-105
transform: scale(1.05)
Scale up to 105%
rotate-45
transform: rotate(45deg)
Rotate 45 degrees
rotate-90
transform: rotate(90deg)
Rotate 90 degrees
rotate-180
transform: rotate(180deg)
Rotate 180 degrees
translate-x-1
transform: translateX(0.25rem)
Move right 4px
translate-y-1
transform: translateY(0.25rem)
Move down 4px
-translate-y-1
transform: translateY(-0.25rem)
Move up 4px
Transitions(10)
transition
transition: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter 150ms ease
Transition all common properties
transition-colors
transition: color, background-color, border-color 150ms ease
Transition only color properties
transition-opacity
transition: opacity 150ms ease
Transition opacity only
transition-transform
transition: transform 150ms ease
Transition transform only
duration-150
transition-duration: 150ms
150ms transition duration
duration-300
transition-duration: 300ms
300ms transition duration
duration-500
transition-duration: 500ms
500ms transition duration
ease-in
transition-timing-function: cubic-bezier(0.4, 0, 1, 1)
Start slow, end fast
ease-out
transition-timing-function: cubic-bezier(0, 0, 0.2, 1)
Start fast, end slow
ease-in-out
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1)
Slow at both ends