Skip to main content

Display Utilities

NuvoUI's display utilities provide a powerful system for controlling how elements are rendered in the document flow, including visibility, display modes, and overflow handling.

Configuration

Display utilities use the following configurable variables:

Breakpoints

The responsive variants of display utilities are generated based on the breakpoint values defined in the VAR.$breakpoints map:

Utility Class Generation

Display utility classes are only generated if VAR.$generate-utility-classes is set to true:

Parent Selector

All utility classes are scoped under the VAR.$parent-selector which can be configured to change the global selector context:

Display Mode Utilities

Control the basic display property of elements with these utilities:

Display Mode Classes

ClassCSS PropertyDescription
.blockdisplay: block;Element takes up full width
.inlinedisplay: inline;Element flows with text
.inline-blockdisplay: inline-block;Inline element with block properties
.d-tbldisplay: table;Element behaves like a table
.d-tbl-rowdisplay: table-row;Element behaves like a table row
.d-tbl-celldisplay: table-cell;Element behaves like a table cell
.contentsdisplay: contents;Element's box is not generated, but children appear as normal

Visibility Utilities

Control whether elements are visible without affecting their layout:

Visibility Classes

ClassCSS PropertyDescription
.visiblevisibility: visible;Element is visible (default)
.invisiblevisibility: hidden;Element is hidden but maintains its space in the layout
.collapsevisibility: collapse;Special value for table rows/columns
.hidedisplay: none;Element is completely removed from the layout
.showdisplay: revert;Restores an element to its natural display value

Overflow Utilities

Control how content that overflows its container is handled:

Axis-Specific Overflow

Control overflow behavior on horizontal and vertical axes independently:

Overflow Classes

ClassCSS PropertyDescription
.overflow-hiddenoverflow: hidden;Clips overflowing content
.overflow-visibleoverflow: visible;Shows content outside container bounds
.overflow-scrolloverflow: scroll;Always shows scrollbars
.overflow-autooverflow: auto;Shows scrollbars only when needed
.overflow-x-hiddenoverflow-x: hidden;Clips horizontal overflow
.overflow-y-hiddenoverflow-y: hidden;Clips vertical overflow
.overflow-x-scrolloverflow-x: scroll;Always shows horizontal scrollbar
.overflow-y-scrolloverflow-y: scroll;Always shows vertical scrollbar
.overflow-x-autooverflow-x: auto;Shows horizontal scrollbar when needed
.overflow-y-autooverflow-y: auto;Shows vertical scrollbar when needed

Responsive Display

Apply display utilities at specific breakpoints using the @breakpoint suffix:

All display utilities support responsive variants with breakpoint suffixes:

  • .hide@md, .show@md
  • .block@lg, .inline@lg
  • .d-tbl@xl, .d-tbl-row@xl
  • .overflow-hidden@sm, .overflow-auto@md

Common UI Patterns

Responsive Navigation

Content Cards with Truncated Text

Collapsible Sections

Table with Horizontal Scrolling

SCSS Mixins

NuvoUI provides a comprehensive set of mixins for using display utilities directly in your SCSS:

Display Mode Mixins

MixinDescriptionCSS Output
@include hide()Hides an elementdisplay: none;
@include block()Makes an element block-leveldisplay: block;
@include inline()Makes an element inlinedisplay: inline;
@include inline-block()Makes an element inline-blockdisplay: inline-block;
@include show()Restores default display valuedisplay: revert;
@include d-tbl()Makes an element behave like a tabledisplay: table;
@include d-tbl-row()Makes an element behave like a table rowdisplay: table-row;
@include d-tbl-cell()Makes an element behave like a table celldisplay: table-cell;
@include contents()Removes element's own box from renderingdisplay: contents;

Visibility Mixins

MixinDescriptionCSS Output
@include visible()Makes an element visiblevisibility: visible;
@include invisible()Hides an element but keeps its spacevisibility: hidden;
@include collapse()Special value for table row/columnvisibility: collapse;

Overflow Mixins

MixinDescriptionCSS Output
@include overflow-hidden()Clips overflowing contentoverflow: hidden;
@include overflow-visible()Shows overflowing contentoverflow: visible;
@include overflow-scroll()Always shows scrollbarsoverflow: scroll;
@include overflow-auto()Shows scrollbars when neededoverflow: auto;
@include overflow-x-hidden()Clips horizontal overflowoverflow-x: hidden;
@include overflow-y-hidden()Clips vertical overflowoverflow-y: hidden;
@include overflow-x-scroll()Always shows horizontal scrollbaroverflow-x: scroll;
@include overflow-y-scroll()Always shows vertical scrollbaroverflow-y: scroll;
@include overflow-x-auto()Shows horizontal scrollbar when neededoverflow-x: auto;
@include overflow-y-auto()Shows vertical scrollbar when neededoverflow-y: auto;

Example SCSS Usage

Display Utilities Reference

Display Mode Classes Summary

ClassCSS OutputDescription
.hidedisplay: none;Removes element from layout
.showdisplay: revert;Restores natural display value
.blockdisplay: block;Block-level element
.inlinedisplay: inline;Inline element
.inline-blockdisplay: inline-block;Inline-block element
.d-tbldisplay: table;Table display mode
.d-tbl-rowdisplay: table-row;Table row display mode
.d-tbl-celldisplay: table-cell;Table cell display mode
.contentsdisplay: contents;Contents display mode

Visibility Classes Summary

ClassCSS OutputDescription
.visiblevisibility: visible;Element is visible
.invisiblevisibility: hidden;Element is hidden but keeps space
.collapsevisibility: collapse;For table rows/columns

Overflow Classes Summary

ClassCSS OutputDescription
.overflow-hiddenoverflow: hidden;Clips overflow
.overflow-visibleoverflow: visible;Shows overflow
.overflow-scrolloverflow: scroll;Always shows scrollbars
.overflow-autooverflow: auto;Shows scrollbars when needed
.overflow-x-hiddenoverflow-x: hidden;Clips horizontal overflow
.overflow-y-hiddenoverflow-y: hidden;Clips vertical overflow
.overflow-x-scrolloverflow-x: scroll;Always shows horizontal scrollbar
.overflow-y-scrolloverflow-y: scroll;Always shows vertical scrollbar
.overflow-x-autooverflow-x: auto;Shows horizontal scrollbar when needed
.overflow-y-autooverflow-y: auto;Shows vertical scrollbar when needed

Responsive Variants

All display utilities can be applied at specific breakpoints using the @breakpoint suffix pattern:

  • .hide@md - Apply on medium screens and up
  • .block@lg - Apply on large screens and up
  • .overflow-auto@xl - Apply on extra large screens and up