Skip to main content

Width Utilities

NuvoUI provides a comprehensive set of utilities for controlling the width of elements, from fixed dimensions to percentage-based and content-aware sizing.

Fixed Width Utilities

Apply specific width values from the spacing scale:

Available Fixed Width Classes

Width utilities are generated from the VAR.$spacings map, including values like:

ClassSizePixels
.w-000px
.w-10.25rem4px
.w-20.5rem8px
.w-41rem16px
.w-82rem32px
.w-123rem48px
.w-164rem64px
.w-246rem96px
.w-328rem128px
.w-4812rem192px
.w-6416rem256px

Percentage Width Utilities

Set width as a percentage of the parent container:

Available Percentage Width Classes

Width percentage utilities are generated from the VAR.$percentages list:

ClassDescription
.w-0pSets width to 0%
.w-5pSets width to 5%
.w-10pSets width to 10%
.w-25pSets width to 25%
.w-33pSets width to 33%
.w-50pSets width to 50%
.w-66pSets width to 66%
.w-75pSets width to 75%
.w-90pSets width to 90%
.w-100pSets width to 100%

Special Width Values

Apply common width values:

Content-Based Width Values

Control width based on content:

Available Special Width Classes

ClassCSS PropertyDescription
.w-autowidth: auto;Default width, based on content and constraints
.w-fullwidth: 100%;Full width of container
.w-screenwidth: 100vw;Full viewport width
.w-minwidth: min-content;Width based on minimum content size
.w-maxwidth: max-content;Width based on maximum content size
.w-fitwidth: fit-content;Width based on fit-content algorithm

Min-Width and Max-Width Utilities

Control minimum and maximum width constraints:

Available Min-Width and Max-Width Classes

  • Min-width classes: Start with min-w- (e.g., min-w-full, min-w-32, min-w-50p)
  • Max-width classes: Start with max-w- (e.g., max-w-full, max-w-64, max-w-75p)
  • Breakpoint-based max-widths: Based on VAR.$breakpoints (e.g., max-w-sm, max-w-md, max-w-lg)

Responsive Width Utilities

Change width at different breakpoints using the @breakpoint notation:

Interactive Width States

Change width on hover or with group interactions:

Common UI Patterns

Container With Maximum Width

Responsive Grid Items

Flexible Form Inputs

Width Utilities Reference Table

Fixed Width Classes

Width utilities are generated from the VAR.$spacings map:

ClassSizePixels
.w-000px
.w-10.25rem4px
.w-20.5rem8px
.w-30.75rem12px
.w-41rem16px
.w-51.25rem20px
.w-61.5rem24px
.w-82rem32px
.w-102.5rem40px
.w-123rem48px
.w-164rem64px
.w-205rem80px
.w-246rem96px
.w-328rem128px
.w-4010rem160px
.w-4812rem192px
.w-5614rem224px
.w-6416rem256px

Percentage Width Classes

Width percentage utilities are generated from the VAR.$percentages list:

ClassDescription
.w-0pSets width to 0%
.w-5pSets width to 5%
.w-10pSets width to 10%
.w-15pSets width to 15%
.w-20pSets width to 20%
.w-25pSets width to 25%
.w-30pSets width to 30%
.w-33pSets width to 33%
.w-40pSets width to 40%
.w-50pSets width to 50%
.w-60pSets width to 60%
.w-66pSets width to 66%
.w-70pSets width to 70%
.w-75pSets width to 75%
.w-80pSets width to 80%
.w-90pSets width to 90%
.w-100pSets width to 100%

Special Width Classes

ClassCSS PropertyDescription
.w-autowidth: auto;Default width, based on content and constraints
.w-fullwidth: 100%;Full width of container
.w-screenwidth: 100vw;Full viewport width
.w-minwidth: min-content;Width based on minimum content size
.w-maxwidth: max-content;Width based on maximum content size
.w-fitwidth: fit-content;Width based on fit-content algorithm

Min-Width Classes

ClassDescription
.min-w-0Sets min-width to 0
.min-w-fullSets min-width to 100%
.min-w-{size}Sets min-width to a specific size from spacing scale
.min-w-{percentage}pSets min-width to a specific percentage

Max-Width Classes

ClassDescription
.max-w-0Sets max-width to 0
.max-w-fullSets max-width to 100%
.max-w-{size}Sets max-width to a specific size from spacing scale
.max-w-{percentage}pSets max-width to a specific percentage
.max-w-{breakpoint}Sets max-width to a specific breakpoint size

SCSS Mixins

NuvoUI provides a comprehensive set of width-related mixins for use in your SCSS:

Width Mixins

MixinDescriptionParameters
@include width($value)Sets width using units$value: width value with units
@include width-percent($i)Sets width as percentage$i: percentage as number
@include min-width($value)Sets minimum width using units$value: width value with units
@include min-width-percent($i)Sets minimum width as percentage$i: percentage as number
@include max-width($value)Sets maximum width using units$value: width value with units
@include max-width-percent($i)Sets maximum width as percentage$i: percentage as number

Special Width Mixins

MixinDescriptionCSS Output
@include w-autoSets width to autowidth: auto;
@include w-fullSets width to 100%width: 100%;
@include w-screenSets width to viewport widthwidth: 100vw;
@include w-maxSets width to max-contentwidth: max-content;
@include w-minSets width to min-contentwidth: min-content;
@include w-fitSets width to fit-contentwidth: fit-content;
@include min-w-fullSets min-width to 100%min-width: 100%;
@include max-w-fullSets max-width to 100%max-width: 100%;

Example SCSS Usage