Responsive Design Made Easy
Tailwind makes building fully responsive, adaptive interfaces a breeze with its built-in modifiers syntax and pre-configured breakpoints.
Every utility class in Tailwind can be made responsive by adding a breakpoint and screen size qualifier directly in your HTML.
Understanding Responsive Modifiers
Responsive design in Tailwind is achieved using class names with screen size suffixes, like md:mt-2
for spacing, lg:hidden
for visibility, and sm:text-blue-500
for text color on smaller screens.
<div class="mt-4 md:mt-8 lg:mt-12">
Breakpoints at a Glance
Breakpoint Name | Screen Size (px) |
---|---|
sm | 640 |
md | 768 |
lg | 1024 | xl | 1280 | 2xl | 1536 |
Common Responsive Examples
Responsive Text Alignment
Use responsive modifiers classes like text-left lg:text-center
or text-center md:text-right
to align text differently on different screen sizes.