Skip to main content

Sizing Utilities

Sizing utilities control the width and height of elements.

They are built using the same spacing scale used throughout NUI CSS, ensuring consistent sizing across layouts.

These utilities are commonly used for layout containers, icons, images, cards, and UI components.


Width Utilities

Width utilities define the horizontal size of elements.


Fixed Width Scale

These utilities map to the NUI spacing scale.

ClassDefault Size
w-00px
w-0-50.125rem
w-10.25rem
w-1-50.375rem
w-20.5rem
w-2-50.625rem
w-30.75rem
w-41rem
w-51.25rem
w-61.5rem
w-82rem
w-102.5rem
w-123rem
w-143.5rem
w-164rem
w-205rem
w-246rem
w-328rem
w-4010rem
w-4812rem
w-6416rem

Example:

<div class="w-32">
Fixed width container
</div>

Fluid Width

Fluid width utilities expand relative to the viewport or parent container.

ClassCSS
w-autowidth: auto
w-fullwidth: 100%
w-screenwidth: 100vw

Example:

<div class="w-full">
Full width container
</div>

Height Utilities

Height utilities control the vertical size of elements.


Fixed Height Scale

ClassDefault Size
h-00px
h-0-50.125rem
h-10.25rem
h-1-50.375rem
h-20.5rem
h-2-50.625rem
h-30.75rem
h-41rem
h-51.25rem
h-61.5rem
h-82rem
h-102.5rem
h-123rem
h-143.5rem
h-164rem
h-205rem
h-246rem
h-328rem
h-4010rem
h-4812rem
h-6416rem

Example:

<div class="h-16">
Fixed height container
</div>

Fluid Height

These utilities control dynamic height.

ClassCSS
h-autoheight: auto
h-fullheight: 100%
h-screenheight: 100vh

Example:

<div class="h-screen flex items-center justify-center">
Full screen section
</div>

Square Elements

Using width and height together allows easy square elements.

Example:

<div class="w-12 h-12 flex items-center justify-center">
Icon
</div>

Common use cases:

  • avatars
  • icons
  • buttons
  • cards

Complete Sizing Class List

Width utilities:

w-0
w-0-5
w-1
w-1-5
w-2
w-2-5
w-3
w-4
w-5
w-6
w-8
w-10
w-12
w-14
w-16
w-20
w-24
w-32
w-40
w-48
w-64
w-auto
w-full
w-screen

Height utilities:

h-0
h-0-5
h-1
h-1-5
h-2
h-2-5
h-3
h-4
h-5
h-6
h-8
h-10
h-12
h-14
h-16
h-20
h-24
h-32
h-40
h-48
h-64
h-auto
h-full
h-screen

These utilities map directly to CSS width and height properties.