Skip to content

Flex Wrap

Controls how flex items are wrapped.

Utility Properties
Error: 429

No Wrap

Initial value

This example sets the flex wrap to nowrap. The items will be displayed in a single line, and they will not wrap to the next line.

A
B
C
<div class="p-r tc-white">
<div class="d-f fw-nw g-4 max-w-30" id="area">
<div class="ai-c bg-indigo d-f jc-c p-4 rad-1">A</div>
<div class="ai-c bg-indigo d-f jc-c p-4 rad-1">B</div>
<div class="ai-c bg-indigo d-f jc-c p-4 rad-1">C</div>
</div>
</div>

Wrap

This example sets the flex wrap to wrap. The items will wrap onto multiple lines if there is not enough space in the container.

A
B
C
<div class="p-r tc-white">
<div class="d-f fw-w g-4 max-w-30" id="area">
<div class="ai-c bg-indigo d-f jc-c p-4 rad-1">A</div>
<div class="ai-c bg-indigo d-f jc-c p-4 rad-1">B</div>
<div class="ai-c bg-indigo d-f jc-c p-4 rad-1">C</div>
</div>
</div>

Wrap Reverse

This example sets the flex wrap to wrap-reverse. The items will wrap onto multiple lines, but the order of the lines will be reversed.

A
B
C
<div class="p-r tc-white">
<div class="d-f fw-wr g-4 max-w-30" id="area">
<div class="ai-c bg-indigo d-f jc-c p-4 rad-1">A</div>
<div class="ai-c bg-indigo d-f jc-c p-4 rad-1">B</div>
<div class="ai-c bg-indigo d-f jc-c p-4 rad-1">C</div>
</div>
</div>

Conditional styles

Learn how to override existing utilities based on the userโ€™s screen size or other factors, such as hover states.

Media modifier

You can combine responsive breakpoints like sm:-*,md:-*, lg:-*, and xxl:-* allows targeting specific utilities in different viewports.

<div class="fw-wr md:fw-w ..."></div>

Hover modifier

Alternatively, you can apply :hover by using h:-* utility to override elements and change their values when hovering over them.

<div class="fw-wr h:fw-w ..."></div>