Skip to main content
Login

Sign in to access your account

Block Layout - National Design System

A block is a spacing unit for content and components, with an optional title

Overview

A block is one class, nds-block, on any element. It makes the element full width and puts a 32px gap below it. The last block in its parent has no gap, and a Divider right after a block sets the gap with its own space. A block has no padding, border or background: add nds-card nds-stroke to box it. Put it on a wrapper around text, or straight on a component such as a grid, a tab set or a table. An optional nds-block-title heading sits at the top. A block needs no JavaScript.

Pick another component when:

  • the content is a new topic with its own heading and background: Section

Markup

Preview

Eligibility

Saudi citizens aged 18 or older can apply. Residents apply through their employer.

The request is reviewed within 5 working days.

Required Documents

  • National ID or Iqama
  • Proof of address

For help, call 19911 from Sunday to Thursday, 8 AM to 4 PM.

<!-- Three blocks. The last one has no title --> <div class="nds-block nds-prose"> <h3 class="nds-block-title">Eligibility</h3> <p>Saudi citizens aged 18 or older can apply. Residents apply through their employer.</p> <p>The request is reviewed within 5 working days.</p> </div> <div class="nds-block nds-prose"> <h3 class="nds-block-title">Required Documents</h3> <ul> <li>National ID or Iqama</li> <li>Proof of address</li> </ul> </div> <div class="nds-block nds-prose"> <p>For help, call 19911 from Sunday to Thursday, 8 AM to 4 PM.</p> </div>

Built-in Features

  • Consistent Vertical Rhythm

    Each block puts a 32px gap below it. The last block in its parent has none, so the parent ends flush. A divider after a block replaces the gap with its own space.

  • Media Sizing

    An <img> that is a direct child is 80% wide and centered, and full width below 960px. A direct <video> is centered, at most 60% of the screen height.

  • Optional Titled Heading

    Add nds-block-title when the block needs a heading. CSS custom properties set its size, weight, color and gap.

  • Works Anywhere

    A block needs no parent: it keeps the same gap in a section body, a card or a grid column.

Best Practices

  • Use blocks to split one section into parts. Start a new section for a new topic.
  • Put each group in its own block. Two groups in one block get no block gap between them.
  • A tab panel or a panel body spaces nothing between its children. Put each part there in a block, and fields in one form.nds-form. The audit’s parts-touch check finds parts that touch.
  • Put nds-block straight on a grid, a tab set or a table. A wrapper around one component adds nothing.
  • Add nds-prose to a block of bare paragraphs and lists, so they get space between them.
  • Do not nest blocks. If a part needs its own heading level, it may belong in a new section.
  • Keep block titles short. A block title is smaller than the section title, so the section title stays the main heading.
  • Leave out the title when the block is the only one in its section: the section title already names it.
  • Write a block title as a real heading (h3 under a section h2), so screen readers list it.
  • Give every image an alt text.

API

Classes

Class Element Effect
nds-block Any element Full width, with a 32px gap below. No gap on the last child, and a divider right after it sets its own space instead
nds-block-title A heading at the top of a block The block’s title. No gap below it when it is the last child
nds-cq .nds-block Makes a grid inside follow the block’s width. Opt-in, because the block no longer takes its width from its content. See Grid

CSS Custom Properties

Set these in the style of .nds-block-title, or of any element around it.

Property Default Controls
--block-title-FS var(--typo-text-xl-FS) Title font size
--block-title-LH var(--typo-text-xl-LH) Title line height
--block-title-FW var(--font-weight-semibold) Title font weight
--block-title-MB var(--spacing-lg) Space below the title
--block-title-color var(--text-display) Title color
Last Modified Date: 08/11/2026 - 04:21 PM
Was this page useful?
60% of users said Yes from 2843 Feedbacks