Post Title
Readable paragraph with optimal vertical rhythm.
Tailwind line height utility classes controls the line height to an element. These utility classes are named using the format leading-{keyword}, where {keyword} represents the line height value.
Line height plays a bigger role in readability than most people give it credit for. It controls how text breathes inside a layout, and getting it wrong can make even good typography feel cramped or sloppy. Tailwind exposes this through the leading-* utilities, which let you tweak vertical rhythm across breakpoints, components, and arbitrary values.
Here’s how the system works and how to use it in real UI situations.
Tailwind gives you two broad options:
Relative values (scale based on font size)
Fixed values (pixel-based, independent of the font)
Each approach solves a different type of layout problem.
Relative line heights are based on the font size of the element. For example, leading-tight with a relative value of 1.25 means the line height will be 1.25 times the font size.
To apply tailwind line height to an element, you can use the leading-{value} utility class, where {value} represents the line height value.
leading-none: Sets the line height to none, causing the lines to overlap.leading-tight: Sets a tight line height, reducing the spacing between lines.leading-snug: Sets a snug line height, slightly reducing the spacing between lines.leading-normal: Sets the default line height.leading-relaxed: Sets a relaxed line height, increasing the spacing between lines.leading-loose: Sets a loose line height, further increasing the spacing between lines.<p class="leading-loose"> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Assumenda, quia temporibus eveniet a libero incidunt suscipit.</p><p class="leading-snug"> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Assumenda, quia temporibus eveniet a libero incidunt suscipit.</p>Leading-relaxed
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Assumenda, quia temporibus eveniet a libero incidunt suscipit.
Leading-tight
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Assumenda, quia temporibus eveniet a libero incidunt suscipit.
Sometimes you want your line height to be predictable no matter the font size — for example, matching a UI spec from Figma or controlling content blocks in dashboards.
<p class="text-base leading-[42px]"> This paragraph has a fixed line height of 32 pixels.</p><p class="text-base leading-[26px]"> This paragraph has a fixed line height of 32 pixels.</p>Leading-relaxed
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Assumenda, quia temporibus eveniet a libero incidunt suscipit.
Leading-tight
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Assumenda, quia temporibus eveniet a libero incidunt suscipit.
Fixed units are especially useful for hero sections, modal titles, and components that require layout precision.
Tailwind CSS allows you to apply line height classes responsively at different breakpoints. To use responsive line height classes, you can append the breakpoint prefix to the utility class. For example, md:leading-snug sets a snug line height starting from the medium breakpoint and above.
<p class="leading-normal md:leading-loose">Lorem ipsum dolor sit amet.</p>Lorem ipsum dolor sit amet.
This pattern works well when you need mobile density without sacrificing readability on desktops.
Tailwind allows arbitrary values whenever you need something outside the default scale:
<p class="leading-[2.45]">Exact numerical line-height</p><p class="leading-[34px]">Pixel-specific line-height</p>Exact numerical line-height
Pixel-specific line-height
Great for teams following strict typographic scales or translating directly from design files.
If your design system uses its own rhythm, you can extend Tailwind’s config:
module.exports = { theme: { extend: { lineHeight: { "extra-tight": "1.1", "extra-loose": "3.5", // Adding a custom line height }, }, },};Use these custom classes in your HTML:
<p class="leading-extra-tight"> This paragraph has a custom line height of 1.1.</p><p class="leading-extra-loose"> This paragraph has a custom line height of 2.5.</p>This paragraph has a custom line height of 1.1.
This paragraph has a custom line height of 3.5.
Custom names improve readability inside long-lived projects.
<article class="prose prose-lg leading-relaxed"> <h1 class="text-3xl leading-tight font-bold">Post Title</h1> <p>Readable paragraph with optimal vertical rhythm.</p></article>Readable paragraph with optimal vertical rhythm.
<label class="block text-sm leading-snug text-gray-600 mb-1"> Email address</label><input class="w-full p-2 border rounded" />Remember me
Don't have account? Signup
Tight line height helps labels stay close to their inputs without looking crowded.
<h1 class="text-5xl leading-none font-extrabold tracking-tight"> Make bold moves.</h1>Make bold moves.
Zero vertical space between lines — creates strong, impactful headlines.
| Class | Properties |
|---|---|
| leading-3 | line-height: .75rem; |
| leading-4 | line-height: 1rem; |
| leading-5 | line-height: 1.25rem; |
| leading-6 | line-height: 1.5rem; |
| leading-7 | line-height: 1.75rem; |
| leading-8 | line-height: 2rem; |
| leading-9 | line-height: 2.25rem; |
| leading-10 | line-height: 2.5rem; |
| leading-none | line-height: 1; |
| leading-tight | line-height: 1.25; |
| leading-snug | line-height: 1.375; |
| leading-normal | line-height: 1.5; |
| leading-relaxed | line-height: 1.625; |
| leading-loose | line-height: 2; |
Now that you’ve mastered Tailwind line Height, try experimenting with:
Windframe is an AI visual editor for rapidly building stunning web UIs & websites
