Overview
naUI ships two layers of flex tooling:
- Atomic utilities - single-property classes like
na-flex, na-items-center, na-justify-between. - Named layout patterns - one-class shortcuts (
na-stack, na-cluster, na-split, na-row) that bundle the most common combinations.
Display
| Class | Property |
|---|
na-flex | display: flex |
na-inline-flex | display: inline-flex |
Direction
| Class | Property |
|---|
na-flex-row | flex-direction: row |
na-flex-column | flex-direction: column |
Wrap
| Class | Property |
|---|
na-flex-wrap | flex-wrap: wrap |
na-flex-nowrap | flex-wrap: nowrap |
Flex sizing
| Class | Property | Use |
|---|
na-flex-1 | flex: 1 1 0% | Fill remaining space |
na-flex-auto | flex: 1 1 auto | Grow & shrink based on content |
na-flex-none | flex: none | Fixed size, no shrink |
na-flex-shrink-0 | flex-shrink: 0 | Prevent shrink |
Alignment
| Class | Property |
|---|
na-items-start | align-items: flex-start |
na-items-center | align-items: center |
na-items-end | align-items: flex-end |
na-items-stretch | align-items: stretch |
na-items-baseline | align-items: baseline |
na-justify-start | justify-content: flex-start |
na-justify-center | justify-content: center |
na-justify-end | justify-content: flex-end |
na-justify-between | justify-content: space-between |
na-justify-around | justify-content: space-around |
na-justify-evenly | justify-content: space-evenly |
na-self-start | align-self: flex-start |
na-self-center | align-self: center |
na-self-end | align-self: flex-end |
na-self-stretch | align-self: stretch |
Gap
| Class | Value |
|---|
na-gap-1 | 0.25rem |
na-gap-2 | 0.5rem |
na-gap-3 | 0.75rem |
na-gap-4 | 1rem |
na-gap-6 | 1.5rem |
na-gap-8 | 2rem |
Named layout patterns
Single-class shortcuts that bundle alignment + direction + gap into a common layout pattern.
Stack
Vertical column with equal gap between children.
| Class | Gap |
|---|
na-stack-s | 0.5rem |
na-stack | 1rem (default) |
na-stack-l | 2rem |
na-stack-xl | 3rem |
<div class="na-stack">
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
</div>
Cluster
Wrapping inline row - items flow left and wrap when they run out of room. Perfect for tag groups and toolbar buttons.
naUI CSS Open Source Layout Zero deps
| Class | Gap |
|---|
na-cluster-s | 0.5rem |
na-cluster | 0.75rem (default) |
na-cluster-l | 1.5rem |
<div class="na-cluster">
<span class="na-badge na-badge-primary">naUI</span>
<span class="na-badge na-badge-secondary">CSS</span>
<span class="na-badge na-badge-success">Open Source</span>
</div>
Split
Pushes the first and last child to opposite ends. Common for toolbars, list rows, and card footers.
<div class="na-split">
<span>Section title</span>
<a href="#" class="na-button na-button-ghost na-button-s">View all</a>
</div>
Row
Horizontal row with vertically centred children and a consistent gap.
Row item label
Supporting text here
| Class | Gap |
|---|
na-row-s | 0.5rem |
na-row | 1rem (default) |
na-row-l | 2rem |
<div class="na-row">
<img src="avatar.jpg" class="na-avatar">
<div>
<div>Jane Doe</div>
<div>Engineer</div>
</div>
</div>
Flex center
Centers children on both axes - ideal for hero banners, empty states, and icon buttons.
<div class="na-flex-center" style="min-height:200px">
<p>Perfectly centred</p>
</div>
Flex cover
na-flex-cover is an absolute overlay that fills its positioned parent and centres children. Use it for loading spinners, image overlays, and empty state layers.
<div class="na-relative" style="min-height:160px">
<img src="cover.jpg" class="na-width-full na-height-full" style="object-fit:cover">
<div class="na-flex-cover" style="background:rgba(0,0,0,.4)">
<span style="color:#fff">Overlay text</span>
</div>
</div>
Class reference
| Class | Description |
|---|
na-flex | display: flex |
na-inline-flex | display: inline-flex |
na-flex-row / col | Set direction |
na-flex-wrap / nowrap | Set wrapping |
na-flex-1 / auto / none | Flex grow/shrink shorthands |
na-flex-shrink-0 | Prevent shrink |
na-items-start / center / end / stretch / baseline | align-items |
na-justify-start / center / end / between / around / evenly | justify-content |
na-self-start / center / end / stretch | align-self on a child |
na-gap-1/2/3/4/6/8 | gap utility |
na-stack / sm / lg / xl | Vertical stack pattern |
na-cluster / sm / lg | Wrapping inline row pattern |
na-split | Space-between row pattern |
na-row / sm / lg | Horizontal row with gap pattern |
na-flex-center | Centre both axes |
na-flex-cover | Absolute fill + centre children |