Skip to main content
Login

Sign in to access your account

Definition List - National Design System

Pairs of a title and a value, with optional icons, in a stacked, table, row or grid layout

Overview

A definition list shows pairs of a title and a value, such as the fields of a profile or the details of a service. The list is nds-definition-list, and each pair is an nds-definition-item. A title can start with an icon.

Pick another component when:

  • the data has several values for each row, or the user sorts it: Tables
  • the items are links to other pages: Link in a plain list
  • the items start actions: Dropmenu
  • each item is a feature with an icon, a title and one line: List

Markup

Options
Layout
Style
Size
More
Preview
Full name
Mohammed Al-Harbi
Email
m.alharbi@example.gov.sa
Organization
Digital Services Department
Position
Senior Developer
<dl class="nds-definition-list"> <div class="nds-definition-item"> <dt> <i class="hgi hgi-stroke hgi-user-account" aria-hidden="true"></i> <span class="nds-label">Full name</span> </dt> <dd>Mohammed Al-Harbi</dd> </div> <div class="nds-definition-item"> <dt> <i class="hgi hgi-stroke hgi-mail-01" aria-hidden="true"></i> <span class="nds-label">Email</span> </dt> <dd id="dl-email"> <span>m.alharbi@example.gov.sa</span> </dd> </div> <div class="nds-definition-item"> <dt> <i class="hgi hgi-stroke hgi-building-02" aria-hidden="true"></i> <span class="nds-label">Organization</span> </dt> <dd>Digital Services Department</dd> </div> <div class="nds-definition-item"> <dt> <i class="hgi hgi-stroke hgi-briefcase-02" aria-hidden="true"></i> <span class="nds-label">Position</span> </dt> <dd>Senior Developer</dd> </div> </dl>

Built-in Features

  • Table View Layout

    Two columns built on CSS subgrid, so titles and values line up across every item.

  • Responsive Table View

    Turn the table layout on for phones, tablets or desktops only. Combine the classes to cover more than one screen range.

  • Divided Borders

    Lines between items in every layout. With a responsive table view, the lines follow the layout on each screen size.

  • Grid Layout

    Items in columns that change with the screen size, set with --max-col, --mid-col and --min-col.

  • CSS Custom Properties

    Custom properties set the icon size, the gaps and the font sizes, so no style needs an override.

  • Automatic Icon Indent

    In the stacked layout, a value lines up with its title's text when the title has an icon.

  • Loading Skeleton

    Gray bars stand in for the titles and values before the page is ready, and while nds-loading is on.

Best Practices

  • Use dl, dt and dd when each title names its value, such as a profile or the details of a service. Screen readers read them as pairs.
  • Keep the stacked layout when values are long or wrap to more lines.
  • Use the table layout for short values side by side. For tablets and wider, add both nds-table-view-md and nds-table-view-lg.
  • Use the row layout for compact details inside a card.
  • Give every title icon aria-hidden="true". The label names the item.
  • A value that needs dir="ltr", such as a time or a phone number, takes it on a <span> inside the <dd>, never on the <dd>. On the <dd>, it moves the value to the left edge of an Arabic page.
  • Keep the label inside an icon-only action button. Screen readers read it as the button’s name.
  • In a divided list that is not a grid, add nds-last-row to the last item when another element comes after it in the list. Otherwise the item keeps the line under it.

API

Other Classes

Class Element Effect
nds-last-row .nds-definition-item Removes the line under the last divided item when another element comes after it in the list

Data Attributes

Attribute Element Effect
data-state="loading" .nds-definition-list The same as nds-loading, for a script that already sets states. Use one of the two

CSS Custom Properties

Set these on the list. nds-sm sets the icon size, the title and value sizes, the buttons, tags and chips, and the row gap. A value in the list’s style attribute wins over the size class.

Property Default Controls
--dl-icon-size 24px Size of a title icon. nds-sm sets 20px. An icon never renders below 18px
--dl-icon-gap 8px Gap between a title icon and its label
--dl-title-FS var(--typo-text-md-FS) Title font size. nds-sm sets --typo-text-sm-FS
--dl-title-LH var(--typo-text-md-LH) Title line height. nds-sm sets --typo-text-sm-LH. Set it with a custom --dl-title-FS
--dl-desc-FS var(--typo-text-md-FS) Value font size. nds-sm sets --typo-text-sm-FS
--dl-desc-LH var(--typo-text-md-LH) Value line height. nds-sm sets --typo-text-sm-LH. Set it with a custom --dl-desc-FS
--row-gap var(--spacing-xl) Gap between items, and on each side of a divider in a stacked list. A divided table uses 8px. nds-sm sets --spacing-lg
--col-gap var(--spacing-xl) Gap between a title and its value in the table layout. The row layout uses var(--spacing-sm)
--gap — Sets both gaps when --row-gap and --col-gap are not set

Tokens

It reads these shared tokens. A change to one also changes other components: see Tokens.

Source: the var() reads in _sass/components/_definition-list.scss.

TokenPreviewValue
--text-primary-paragraph
Read by color

var(--colors-neutral-700)
Dark mode var(--colors-neutral-300)
--text-secondary-paragraph
Read by color

var(--colors-neutral-500)
Dark mode var(--colors-neutral-400)
--divider-color
Read by border-bottom

var(--colors-alpha-black-10)
Dark mode var(--colors-alpha-white-10)
--icon-primary
Read by color

var(--colors-primary-600)
Dark mode var(--colors-primary-400)
Last Modified Date: 05/11/2026 - 12:02 PM
Was this page useful?
60% of users said Yes from 2843 Feedbacks