Browse documentation
Reference / Flexbox & grid
Flex shrink
Choose which items may get smaller when their preferred widths exceed the available space.
Working example
M
Monochrome print workshop
A shrink factor of zero protects a thumbnail’s width. Allow the adjacent description to wrap in the remaining space.
<div class="flex max-w-52 items-center gap-3">
<span class="grid size-12 shrink-0 place-items-center bg-black text-white">M</span>
<p class="min-w-0 shrink">Monochrome print workshop</p>
</div>Class reference
| Class | CSS declarations |
|---|---|
shrink | flex-shrink: 1; |
shrink-0 | flex-shrink: 0; |
shrink-2 | flex-shrink: 2; |
shrink-[3] | flex-shrink: 3; |
View full generated CSS
.shrink {
flex-shrink: 1;
}
.shrink-0 {
flex-shrink: 0;
}
.shrink-2 {
flex-shrink: 2;
}
.shrink-\[3\] {
flex-shrink: 3;
}