v1.6.x-dev NDS IQ v6

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.

<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" slides-max="3" slides-mid="2" slides-min="1" peek="40"> <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>

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-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-primaryDark green background with on-color text
nds-greenDark green 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-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
Last Modified Date: 31/07/2026 - 05:11 AM
Was this page useful?
60% of users said Yes from 2843 Feedbacks