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. Repeatable: stack several │ to put multiple titled blocks on one surface. See Tier 7) │ ├── 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 │ │ │ └── span.nds-featured-icon.nds-section-icon (optional mark, sized to the 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 spacing unit — see below) │ ├── 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.

<section class="nds-content-section nds-demo-section"> <h2 class="nds-section-title">Section Title</h2> <p class="nds-section-description">Section description goes here. Used for simple sections with only a title and content.</p> <div class="nds-section-body"> <p>Section content area.</p> </div> </section>

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.

<section class="nds-content-section nds-demo-section"> <div class="nds-section-wrapper"> <div class="nds-section-head"> <h2 class="nds-section-title">Section Title</h2> <p class="nds-section-description">Description text wrapped with content inside a section wrapper.</p> </div> <div class="nds-section-body"> <p>Section content area.</p> </div> </div> </section>

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.

<section class="nds-content-section nds-demo-section"> <div class="nds-section-wrapper"> <div class="nds-section-head"> <h2 class="nds-section-title">Latest News</h2> <p class="nds-section-description">Stay up to date with the latest updates and announcements.</p> </div> <div class="nds-section-action"> <a href="#" class="nds-btn nds-primary"> <span class="nds-label">View All</span> </a> </div> <div class="nds-section-body"> <p>News cards or content goes here.</p> </div> </div> </section>

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.

<section class="nds-content-section nds-demo-section"> <div class="nds-section-wrapper"> <div class="nds-section-head"> <div class="nds-section-action"> <a href="#" class="nds-btn nds-primary" aria-label="View All"> <i class="nds-icon nds-hgi-arrow-prev-01" aria-hidden="true"></i> <span class="nds-label">View All</span> </a> </div> <h2 class="nds-section-title">Section Title</h2> <p class="nds-section-description">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.</p> </div> <div class="nds-section-body"> <p>Section content area.</p> </div> </div> </section>

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.

<section class="nds-content-section nds-demo-section nds-ghost"> <div class="nds-section-wrapper"> <div class="nds-section-head"> <div class="nds-section-action"> <a href="#" class="nds-btn nds-subtle"> <i class="nds-icon nds-hgi-share-01" aria-hidden="true"></i> <span class="nds-label">Share</span> </a> </div> <h2 class="nds-section-title">Section Title</h2> <p class="nds-section-description">Float action in the head, standard action outside for secondary controls.</p> </div> <div class="nds-section-action"> <a href="#" class="nds-btn nds-primary"> <span class="nds-label">View All</span> </a> <a href="#" class="nds-btn nds-secondary-outline"> <span class="nds-label">Download</span> </a> </div> <div class="nds-section-body"> <p>Section content area.</p> </div> </div> </section>

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.

<section class="nds-content-section nds-demo-section"> <div class="nds-section-wrapper"> <div class="nds-section-head"> <h2 class="nds-section-title">Section Title</h2> <p class="nds-section-description">The action stays inline on all breakpoints.</p> </div> <div class="nds-section-action nds-nowrap"> <a href="#" class="nds-btn nds-primary nds-sm"> <span class="nds-label">Action</span> </a> </div> <div class="nds-section-body"> <p>Resize the browser to mobile width. The action stays beside the head.</p> </div> </div> </section>

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.

<section class="nds-content-section nds-demo-section"> <div class="nds-section-wrapper"> <div class="nds-section-image"> <div class="nds-avatar"> <i class="nds-icon nds-icon-avatar" aria-hidden="true"></i> </div> </div> <div class="nds-section-head"> <h2 class="nds-section-title">Faculty Profile</h2> <p class="nds-section-description">Professor of Computer Science, College of Engineering.</p> </div> <div class="nds-section-action"> <a href="#" class="nds-btn nds-primary"> <span class="nds-label">Contact</span> </a> </div> <div class="nds-section-body"> <p>Profile details and content goes here.</p> </div> </div> </section>

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. This demo is live on the page itself — the swiper below escapes the content max-width to the viewport gutter edge (a nested demo card can't show this: the breakout resolves against its container, not the page).

Identity Verification Verify your national identity and obtain digital certificates for government transactions
Passport Renewal Renew your passport online with expedited processing and home delivery options
Birth Certificate Request Request official birth certificates and family documentation online
Marriage Contract Registration Register marriage contracts and obtain official marriage certificates
Driver's License Services Apply for, renew, or update your driving license information
Vehicle Registration Register new vehicles, transfer ownership, or renew your vehicle registration
<section class="nds-content-section"> <div class="nds-section-wrapper"> <div class="nds-section-head"> <h2 class="nds-section-title">Related Services</h2> <p class="nds-section-description">Explore other government digital services that may be relevant to you.</p> </div> <div class="nds-section-action"> <a href="#" class="nds-btn nds-primary"> <span class="nds-label">View All</span> </a> </div> </div> <div class="nds-section-body nds-max-width"> <div class="nds-swiper" style="--max-slides:3; --mid-slides:2; --min-slides:1; --peek:40px"> <div class="nds-swiper-wrapper"> <div class="nds-swiper-slide"> <div class="nds-card nds-stroke"> <div class="nds-card-header"> <div class="nds-card-featured-icon"> <span class="nds-featured-icon nds-circle nds-xl"> <i class="hgi hgi-stroke hgi-user-id-verification"></i> </span> </div> </div> <div class="nds-card-content"> <div class="nds-card-text"> <span class="nds-card-title nds-truncate">Identity Verification</span> <span class="nds-card-description nds-truncate">Verify your national identity and obtain digital certificates.</span> </div> </div> <div class="nds-card-actions"> <a href="#" class="nds-btn nds-secondary-outline nds-lg"><span class="nds-label">Details</span></a> <a href="#" class="nds-btn nds-primary nds-lg nds-trail-icon"><span class="nds-label">Get Started</span></a> </div> </div> </div> <!-- more slides... --> </div> <div class="nds-swiper-navigation" hidden> <div class="nds-swiper-buttons"> <button class="nds-btn nds-primary nds-icon-only nds-circle nds-md nds-prev" type="button" aria-label="Previous slide"></button> <button class="nds-btn nds-primary nds-icon-only nds-circle nds-md nds-next" type="button" aria-label="Next slide"></button> </div> <div class="nds-swiper-pagination"></div> </div> </div> </div> </section>

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
<section class="nds-content-section nds-demo-section nds-horizontal"> <div class="nds-section-wrapper nds-grid" style="--max-track: 5fr 7fr; --mid-track: 1fr;"> <div class="nds-section-head"> <h2 class="nds-section-title">Side by Side</h2> <p class="nds-section-description">Head and content are displayed in a horizontal grid on desktop screens.</p> <div class="nds-section-action"> <a href="#" class="nds-btn nds-primary"> <span class="nds-label">View All</span> </a> </div> </div> <div class="nds-section-body"> <img src="https://placehold.co/600x400/e2e8f0/475569?text=Content+Image" alt="Placeholder image" style="border-radius: var(--radius-lg); width: 100%;"> </div> </div> </section>

Tier 7: Stacked Wrappers

Several titled blocks inside one section, sharing a single surface. Use it where a section has a visible surface of its own: card view, where each section paints as a card, and striped layouts, where sections alternate background.

Three blocks on one surface

Profile

The first block carries the heading that names the whole surface.

Section content area.

Experience

Each following block keeps its own head and body.

Section content area.

Publications

Spacing between blocks is handled for you, so no extra classes are needed.

Section content area.

<section class="nds-content-section nds-neutral"> <div class="nds-section-wrapper"> <div class="nds-section-head"> <h2 class="nds-section-title">Profile</h2> <p class="nds-section-description">The first block carries the heading that names the whole surface.</p> </div> <div class="nds-section-body"> <p>Section content area.</p> </div> </div> <div class="nds-section-wrapper"> <div class="nds-section-head"> <h2 class="nds-section-title">Experience</h2> <p class="nds-section-description">Each following block keeps its own head and body.</p> </div> <div class="nds-section-body"> <p>Section content area.</p> </div> </div> <div class="nds-section-wrapper"> <div class="nds-section-head"> <h2 class="nds-section-title">Publications</h2> <p class="nds-section-description">Spacing between blocks is handled for you, so no extra classes are needed.</p> </div> <div class="nds-section-body"> <p>Section content area.</p> </div> </div> </section>

Title Icon

A mark that sits beside the heading, for sections that carry an emblem or a category symbol. Put nds-section-icon inside the title and it takes the heading height, so it rescales with the title on every breakpoint. The title holds the mark on one row, so a long heading wraps its text and leaves the mark in place. Add nds-center to the section to center the head and stack the mark above the text.

Digital services

Services you can complete online, without a visit to a branch.

Section content area.

<section class="nds-content-section"> <div class="nds-section-wrapper"> <div class="nds-section-head"> <h2 class="nds-section-title"> <span class="nds-featured-icon nds-section-icon"> <i class="hgi hgi-stroke hgi-stars"></i> </span> Digital services </h2> <p class="nds-section-description">Services you can complete online, without a visit to a branch.</p> </div> <div class="nds-section-body"> <p>Section content area.</p> </div> </div> </section>

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.

Stacked Wrappers

Repeat the wrapper to put several titled blocks on one surface, spaced apart for you. In card view they share a single card instead of becoming separate cards, and in striped layouts they hold one stripe instead of alternating.

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, or stack several nds-section-wrapper children when each part needs its own title and description
  • Use stacked wrappers when several titled blocks belong on one surface: a profile or record page in card view that should read as a single card, or related blocks in a striped layout that should hold one background instead of alternating. In a plain layout with no striping, separate sections already read as one flow, so stacking gains nothing
  • Leave a stacked section as a plain block. It spaces its wrappers already, so adding nds-flex and a --gap doubles every break and leaks the gap into nested flex containers. To widen or tighten the breaks, set --section-wrapper-gap on the section
  • Remember that striping counts sections, not wrappers. Merging several sections into one flips the stripe parity of every section below it, so check the rest of the page after the change
  • 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-primary for hero-level emphasis, and nds-brand or nds-ghost for subtle visual separation between adjacent sections

Content Spacing

  • Flow content in a section body is spaced automatically. Paragraphs, lists, tables, and code blocks get a bottom margin, and list items get vertical padding: write plain <p>, <ul>, and <ol> with no spacing classes
  • The rhythm is direction-aware. Arabic fills more of the line box than Latin at the same size, so RTL gets one step more padding between list items than LTR
  • Nested lists indent one step per level and read as a tighter cluster under their parent item. Nested <ol> markers cycle 1.a.i., while an <ol> inside a <ul> stays decimal because it starts a new count
  • Lists inside nav, nds-scroll-more, nds-drawer, or a nds-drawer-list item opt out, because those components space their own items. Do not wrap a prose list in one of these containers or it loses the automatic spacing

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-primaryDeep primary background with on-color text
nds-greenDeep primary background with on-color text (alias for nds-primary)
nds-gradient-primaryDiagonal gradient background (deprecated alias: nds-gradient-green), 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-blockSpacing only: full width plus a bottom margin, dropped on the last one. It is not a container and it groups nothing, so put it straight on a block-level component such as a stepper, tab set, or table. Wrap elements in one only when they really are a single group; two groups need two blocks, or the gap between them never appears
nds-max-widthOn nds-section-body: breaks out of content padding to span the full available width
nds-full-widthOn a section child: spans the full viewport width, regardless of the container. nds-max-width only cancels the wrapper padding, so it stops at its container edge. The two differ when the container is narrower than the screen, such as beside a side menu
nds-fullOn nds-section-title, 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-wrapper-gapvar(--spacing-6xl)Space between stacked wrappers, when one wrapper directly follows another. Set it on the section
--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-icon-sizevar(--section-title-FS), 48px when centeredHeight of .nds-section-icon when it sits inside the title. A centered title stacks the mark above the text, so it stops tracking the title size. Setting this knob overrides both
--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
Last Modified Date: 15/09/2026 - 12:22 PM
Was this page useful?
60% of users said Yes from 2843 Feedbacks