AgentSheet
Back
🎨

Tailwind CSS

cssstylingfrontend

Layout

ClassDescription
flex / inline-flexFlexbox
grid / inline-gridCSS Grid
block / inline / inline-block / hiddenDisplay
containerCentered max-width container
flex-row / flex-colFlex direction
flex-wrap / flex-nowrapWrap behavior
items-center / items-start / items-endAlign items
justify-center / justify-between / justify-aroundJustify content
flex-1 / flex-none / flex-autoFlex grow/shrink
<div class="flex items-center justify-between gap-4">
<div class="grid grid-cols-3 gap-4">

Spacing

ClassDescription
p-4 / px-4 / py-2 / pt-1Padding (0.25rem steps)
m-4 / mx-auto / my-2Margin
gap-4 / gap-x-2 / gap-y-6Gap (flex/grid)
space-x-4 / space-y-2Space between children
space-x-reverseReverse space direction

Scale: 0 1 2 3 4 5 6 8 10 12 16 20 24 32 40 48 56 64 72 80 96

Typography

ClassDescription
text-xs β†’ text-9xlFont size
font-thin font-normal font-medium font-semibold font-boldFont weight
text-gray-500 / text-blue-600Text color
leading-none / leading-tight / leading-normal / leading-relaxedLine height
tracking-tighter / tracking-normal / tracking-widestLetter spacing
text-left / text-center / text-rightText align
uppercase / lowercase / capitalizeText transform
truncate / line-clamp-3Text overflow

Colors & Backgrounds

ClassDescription
bg-white / bg-gray-100 / bg-blue-500Background color
bg-opacity-50Background opacity
text-* / border-*Text & border colors
from-* / via-* / to-*Gradient stops
bg-gradient-to-r / bg-gradient-to-bGradient direction

Color scale: 50 100 200 300 400 500 600 700 800 900 950

Borders & Rounded

ClassDescription
border / border-2 / border-4Border width
border-gray-200Border color
border-t / border-x / border-bBorder sides
rounded / rounded-lg / rounded-xl / rounded-fullBorder radius
rounded-t-lg / rounded-br-mdPer-corner radius

Shadows

ClassDescription
shadow-sm / shadow / shadow-md / shadow-lg / shadow-xlBox shadow
shadow-innerInner shadow
shadow-noneRemove shadow
shadow-colorColored shadow (Tailwind v4)

Responsive Breakpoints

PrefixMin width
(default)0px
sm:640px
md:768px
lg:1024px
xl:1280px
2xl:1536px
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3">
<p class="text-sm md:text-base lg:text-lg">

States

PrefixTrigger
hover:Mouse hover
focus:Keyboard/focus
active:Mouse down
disabled:Disabled state
group-hover:Parent hover (use group on parent)
peer-*:Sibling state (use peer on sibling)
dark:Dark mode
<button class="bg-blue-500 hover:bg-blue-600 focus:ring-2">
<div class="group"><span class="group-hover:text-blue-500">

Transitions & Animations

ClassDescription
transition / transition-all / transition-colorsTransition
duration-150 / duration-300 / duration-500Duration
ease-in / ease-out / ease-in-outEasing
animate-spin / animate-ping / animate-pulse / animate-bounceBuilt-in animations
delay-75 / delay-150Transition delay

Arbitrary Values

Use [] for custom values not in the default scale:

<div class="w-[137px] h-[42px]">
<p class="text-[13px] leading-[1.6]">
<div class="bg-[#1da1f2] top-[calc(100%-1rem)]">

Common Component Patterns

Card

<div class="rounded-lg border bg-white p-6 shadow-md">

Button

<button class="rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors">

Input

<input class="w-full rounded-md border border-gray-300 px-3 py-2 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 outline-none">

Badge

<span class="inline-flex items-center rounded-full bg-blue-100 px-2.5 py-0.5 text-xs font-medium text-blue-800">