naUI
Components Helpers

Utilities

Display, flex, position, overflow, colour, border, shadow, and cursor helpers.

Spacing

Margin and padding utilities follow the pattern na-{property}-{size}. Sizes map to the spacing scale tokens.

Class patternPropertiesScale
na-margin-{n}margin0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 14, 16, 20, 24
na-mt / mr / mb / ml-{n}margin top/right/bottom/left
na-margin-x-{n}margin-inline
na-margin-y-{n}margin-block
na-margin-x-automargin-inline: auto
na-padding-{n}padding
na-pt / pr / pb / pl-{n}padding top/right/bottom/left
na-padding-x-{n}padding-inline
na-padding-y-{n}padding-block
<div class="na-margin-top-8 na-margin-bottom-4 na-padding-x-6">...</div>

Display

ClassValue
na-blockdisplay: block
na-inline-blockdisplay: inline-block
na-inlinedisplay: inline
na-hiddendisplay: none
na-flexdisplay: flex
na-inline-flexdisplay: inline-flex
na-griddisplay: grid

Text

na-text-xs - 0.75rem

na-text-s - 0.875rem

na-text (base) - 1rem

na-text-l - 1.125rem

na-text-xl - 1.25rem

na-text-2xl - 1.5rem

na-font-weight-700

na-font-weight-600

na-font-weight-400

na-text-muted

na-text-center

na-uppercase

na-truncate - long text gets truncated with an ellipsis when it overflows

<p class="na-text-s na-text-muted">Helper text</p>
<span class="na-font-weight-600">Label</span>
<h2 class="na-text-2xl na-font-weight-700">Heading</h2>

Colour

na-text-primary na-text-success na-text-warning na-text-danger na-text-info na-text-muted
na-bg-primary na-bg-success na-bg-warning na-bg-danger na-bg-gray-100
<span class="na-text-danger">Error</span>
<div class="na-bg-primary na-text-white na-padding-4">...</div>

Flex helpers

ClassValue
na-items-start / center / end / stretchalign-items
na-justify-start / center / end / between / aroundjustify-content
na-flex-wrap / na-flex-nowrapflex-wrap
na-flex-columnflex-direction: column
na-flex-1flex: 1
na-flex-autoflex: auto
na-flex-noneflex: none
na-gap-{n}gap

Width & height

ClassValue
na-width-fullwidth: 100%
na-width-autowidth: auto
na-height-fullheight: 100%
na-height-screenheight: 100vh
na-min-width-0min-width: 0
na-max-width-fullmax-width: 100%

Border & radius

ClassValue
na-border1px solid border
na-border-top / right / bottom / leftSingle-side border
na-border-noneborder: none
na-rounded-none / s / m / l / fullborder-radius scale (framework uses 0 as default)

Overflow & position

ClassValue
na-overflow-hiddenoverflow: hidden
na-overflow-autooverflow: auto
na-overflow-scrolloverflow: scroll
na-relativeposition: relative
na-absoluteposition: absolute
na-stickyposition: sticky
na-sr-onlyVisually hidden (screen reader accessible)