Section Layout - National Design System

A structured container for organizing page content into titled blocks with optional actions, images, color themes, and full-width breakout areas.

Section Hierarchy

The section component uses responsive padding for content constraining and a flex wrapper for grouping head, action, image, and content.

Section Structure
section.nds-content-section.nds-demo-section (responsive padding for content constraining) ├── div.nds-section-wrapper (Flex row + responsive breakpoints) │ ├── div.nds-section-image (optional) │ ├── div.nds-section-head (flex:1, title + desc + meta) │ │ ├── div.nds-section-action (optional float, must be first child) │ │ │ Modifiers: .nds-minimal (icon-only on mobile) | .nds-wrap (allow wrap) │ │ ├── h2.nds-section-title │ │ ├── div.nds-section-meta │ │ └── p.nds-section-description │ ├── div.nds-section-action (optional, auto width. Add .nds-nowrap to keep inline on mobile) │ └── div.nds-section-body (full row below) │ └── div.nds-block (optional content grouping) │ ├── h3.nds-block-title (optional) │ └── p, ul, ol, img... (direct content) └── div.nds-section-body.nds-max-width (outside wrapper for breakout)

Tier 1: Minimal (No Wrapper)

Simplest usage: title, description, and content as direct children of the section grid. No wrapper needed.

Section Title

Section description goes here. Used for simple sections with only a title and content.

Section content area.

Tier 2: Standard (With Wrapper)

Wrapper groups head and content with consistent gap spacing. Used for most sections.

Section Title

Description text wrapped with content inside a section wrapper.

Section content area.

Tier 3: With Action

Action buttons sit beside the head on desktop and drop to full-row below on tablet and smaller.

Latest News

Stay up to date with the latest updates and announcements.

News cards or content goes here.

Float Action

Place the action as the first child inside the section head. It floats to the inline-end, letting the title and description text wrap around it. Not compatible with .nds-center or .nds-horizontal layouts. Add .nds-minimal to hide button labels on mobile (icon-only) or .nds-wrap to allow items to wrap.

Section Title

The action button floats to the inline-end corner while the title and description text wrap around it naturally. This creates a compact layout without the action taking its own flex row.

Section content area.

Dual Action

A section can have both a float action inside the head and a standard action outside. The outside action automatically wraps to a full row when a float action is present.

Section Title

Float action in the head, standard action outside for secondary controls.

Section content area.

Action Wrapping: nds-nowrap

By default, the standard action wraps to a full row on mobile. Add .nds-nowrap to keep it inline.

Section Title

The action stays inline on all breakpoints.

Resize the browser to mobile width. The action stays beside the head.

Tier 4: With Image

Image, head, and action form a flex row. Content takes full row below.

Faculty Profile

Professor of Computer Science, College of Engineering.

Profile details and content goes here.

Tier 5: Max-Width Breakout

Content lives outside the wrapper and uses .nds-max-width to break out of the content padding into the full available width. Wrapper holds head + action only.

Related Services

Explore other government digital services that may be relevant to you.

Tier 6: Horizontal Layout

Add .nds-horizontal to a section to switch the wrapper from flex to a two-column grid layout on desktop (head start, content end).

Side by Side

Head and content are displayed in a horizontal grid on desktop screens.

Placeholder image

Built-in Features

Progressive Tiers

Start with a minimal title and body, then layer in wrappers, actions, images, and full-width breakouts as the layout demands.

Color Themes

Apply primary, neutral, brand, gradient, or ghost backgrounds with a single class. Text colors adapt automatically to maintain contrast.

Horizontal Layout

Switch to a side-by-side grid with nds-horizontal for sections where the head and content sit next to each other on desktop.

Float and Dual Actions

Place actions beside the title as a float, outside the head as a standard row, or both at once for primary and secondary controls.

Full-Width Breakout

Content marked with nds-max-width breaks out of the content padding to span the full available width, ideal for carousels and media.

Fluid Typography

Title and description sizes scale smoothly between mobile and desktop using clamp-based tokens, with every value overridable through CSS custom properties.

Container Query Anchor

The wrapper establishes a named section CSS container. Nested grids and components respond to the actual column width, not just the viewport — correct sizing in sidebar layouts where the content column is narrower than the screen.

Usage Guidelines

Best Practices

  • Use sections as the primary building block for all page content. Every distinct content area on a page should be wrapped in its own nds-content-section
  • Use Tier 2 (with wrapper) as the default starting point. Only drop to Tier 1 for truly minimal sections that need no action or image
  • Use full-width breakout for content that benefits from edge-to-edge display: carousels, Swiper components, wide image galleries, or full-bleed media
  • Use horizontal layout for marketing-style sections where a text block and visual sit side by side, like feature highlights or call-to-action blocks
  • Do not use sections for small inline UI elements. Use Cards for self-contained content items, or Accordion for collapsible groups
  • Do not nest nds-content-section inside another nds-content-section. Use a block to subdivide content within a section
  • Choose float action when the action is secondary and the title area has room. Choose standard action when the action buttons are prominent and should have their own row on mobile
  • Add nds-nowrap to the action container only when the action is compact (a single small button) and should stay inline at all breakpoints
  • Use color themes sparingly. Reserve nds-primary and nds-gradient-green for hero-level emphasis, and nds-brand or nds-ghost for subtle visual separation between adjacent sections

Modifier Classes

ClassDescription
nds-centerCenters all section content (head, action, body) in a column layout
nds-horizontalSwitches the wrapper to a two-column grid on desktop (head start, content end)
nds-primaryDark green background with on-color text
nds-greenDark green background with on-color text (alias for nds-primary)
nds-gradient-greenDiagonal gradient background, direction-aware (flips for RTL/LTR)
nds-neutralDark neutral background with on-color text
nds-brandLight brand background with inset shadow, adapts for dark mode
nds-ghostRemoves all background, border, and shadow (transparent section)
nds-max-widthOn nds-section-body: breaks out of content padding to span the full available width
nds-fullOn nds-section-subtitle or nds-section-description: removes the 720px paragraph width cap so the text spans the section width
nds-minimalOn float action: hides button labels on mobile (icon-only)
nds-wrapOn float action: allows action to wrap below the title on mobile instead of floating
nds-nowrapOn standard action: keeps action inline at all breakpoints instead of wrapping to full row
nds-noBgRemoves section background, border, and shadow (alias for nds-ghost)

CSS Custom Properties

Property Default Description
--section-bgvar(--background-default)Section background color
--section-shadownoneSection box shadow
--section-bordernoneSection border
--section-border-radius0Section border radius
--section-title-colorvar(--text-display)Title text color
--section-subtitle-colorvar(--text-secondary-paragraph)Subtitle text color
--section-description-colorvar(--text-default)Description text color
--section-text-colorinheritGeneral text color inside section
--section-padding-blockvar(--spacing-5xl)Vertical padding shorthand (top and bottom)
--section-padding-block-startvar(--section-padding-block)Top padding override
--section-padding-block-endvar(--section-padding-block)Bottom padding override
--section-margin-block-start0Top margin
--section-margin-block-end0Bottom margin
--section-col-gapvar(--spacing-xl)Column gap between head and action in the wrapper
--section-row-gapvar(--spacing-4xl)Row gap between wrapper children
--section-title-FSvar(--typo-display-clamp-md-FS)Title font size
--section-title-LHvar(--typo-display-clamp-md-LH)Title line height
--section-title-MBvar(--typo-display-clamp-md-MB)Title bottom margin
--section-subtitle-FSvar(--typo-text-clamp-lg-FS)Subtitle font size
--section-subtitle-LHvar(--typo-text-clamp-lg-LH)Subtitle line height
--section-subtitle-MBvar(--section-title-MB)Subtitle bottom margin
--section-description-FSvar(--typo-text-clamp-lg-FS)Description font size
--section-description-LHvar(--typo-text-clamp-lg-LH)Description line height
--section-description-MBvar(--spacing-2xl)Description bottom margin
--section-shape-sizevar(--section-title-FS)Size of decorative shape in the title
--section-image-MBvar(--spacing-2xl)Image bottom margin (outside wrapper)
--block-title-FSvar(--typo-text-xl-FS)Content block title font size
--block-title-LHvar(--typo-text-xl-LH)Content block title line height
--block-title-FW600Content block title font weight
--block-title-MBvar(--spacing-lg)Content block title bottom margin
--block-title-colorvar(--text-display)Content block title color
Was this page useful?
60% of users said Yes from 2843 Feedbacks