Production UIs reuse a handful of layouts. Tailwind makes them composable without new CSS files each time.
Patterns to know
- Holy grail shell —
min-h-screen flex flex-colwithflex-1main - Sidebar + content —
grid lg:grid-cols-[240px_1fr]or flex with fixed sidebar width - Centered auth card —
min-h-screen flex items-center justify-center p-4 - Responsive stack → row —
flex flex-col md:flex-row gap-4
Important interview questions and answers
- Q: How do you build a full-height app shell?
A:min-h-screenon the outer wrapper, flex column,flex-1on main so footer stays at bottom. - Q: When does absolute positioning beat flex?
A: Overlays, badges on avatars, decorative elements—not primary document flow.
Self-check
- Sketch class names for a vertically centered login card.
- Why combine grid and flex in the same project?