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
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.
Variants
| Group | Option | Markup | On element | Use |
|---|---|---|---|---|
| Example | Titled blocks (default) | — | — | Text that belongs together under one heading. Add nds-prose to a block of bare paragraphs and lists. The title is optional |
| Example | Block on a component | canon #block-component |
— | Gives a grid, a tab set or a table the same gap as a text block. Put nds-block on the component itself, not on a wrapper |
| Card | Card | .nds-card |
.nds-block:not(.nds-grid) |
Puts each block in a card with padding and a 1px border. Write both classes. Not on a block that is a grid |
| Card | Card | .nds-stroke |
.nds-block:not(.nds-grid) |
The card’s border. Written with nds-card |
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-titlewhen 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’sparts-touchcheck finds parts that touch. - Put
nds-blockstraight on a grid, a tab set or a table. A wrapper around one component adds nothing. - Add
nds-proseto 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 (
h3under a sectionh2), so screen readers list it. - Give every image an
alttext.
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 |