Cookies on ons.gov.uk

Cookies are small files stored on your device when you visit a website. We use some essential cookies to make this website work.

We would like to set additional cookies to remember your settings and understand how you use the site. This helps us to improve our services.

You have accepted all additional cookies. You have rejected all additional cookies. You can change your cookie preferences at any time.

Skip to main content

Description list

Use a description list to organise and display important information about a business, object, product or system.

Example Description List contents

Nunjucks

{% from "components/description-list/_macro.njk" import onsDescriptionList %}
{{
    onsDescriptionList({
        "classes": "ons-u-mb-no",
        "descriptionListLabel": "Information about this business and its survey requirements",
        "termCol": "2",
        "descriptionCol": "10",
        "itemsList": [
            {
                "term": "Survey:",
                "descriptions": [
                    {
                        "description": "Bricks & Blocks"
                    }
                ]
            },
            {
                "term": "RU Refs:",
                "descriptions": [
                    {
                        "description": "49900000118"
                    },
                    {
                        "description": "49300005832"
                    }
                ]
            },
            {
                "term": "Business:",
                "descriptions": [
                    {
                        "description": "Bolts & Ratchets Ltd."
                    }
                ]
            },
            {
                "term": "Trading as:",
                "descriptions": [
                    {
                        "description": "Bolts & Ratchets"
                    }
                ]
            },
            {
                "term": "To:",
                "descriptions": [
                    {
                        "description": "Jacky Turner"
                    },
                    {
                        "description": "Louise Goodland"
                    }
                ]
            }
        ]
    })
}}

Nunjucks macro options

NameTypeRequiredDescription
idstringfalseThe HTML id for the description list (<dl>)
classesstringfalseClasses to apply to description list (<dl>)
descriptionListLabelstringfalseSets the HTML title and aria-label attributes to provide additional information about the description list
termColnumbertrueThe number of grid columns used for the <dt> elements above medium breakpoint
descriptionColnumbertrueThe number of grid columns used for the <dd> elements above medium breakpoint
itemsListarray<Item>trueSettings for the terms and descriptions of the description list items
variantstringfalseSet to "inline" to display the description list inline
Item
NameTypeRequiredDescription
termstringtrueThe value of the description term
descriptionsarray<Description>trueSettings for each description item
Description
NameTypeRequiredDescription
idstringfalseThe HTML id for the description of the related term
descriptionstringtrueThe value of the description of the related term

HTML

<dl class="ons-description-list ons-description-list__items ons-grid ons-grid--gutterless ons-u-cf ons-u-mb-no"
  title="Information about this business and its survey requirements"
  aria-label="Information about this business and its survey requirements">
  <div class="ons-description-list__item">
    <dt class="ons-description-list__term ons-grid__col ons-col-2@m">Survey:</dt>
    <dd class="ons-description-list__value ons-grid__col ons-col-10@m">Bricks &amp; Blocks</dd>
  </div>
  <div class="ons-description-list__item">
    <dt class="ons-description-list__term ons-grid__col ons-col-2@m">RU Refs:</dt>
    <dd class="ons-description-list__value ons-grid__col ons-col-10@m">49900000118</dd>
    <dd class="ons-description-list__value ons-grid__col ons-col-10@m">49300005832</dd>
  </div>
  <div class="ons-description-list__item">
    <dt class="ons-description-list__term ons-grid__col ons-col-2@m">Business:</dt>
    <dd class="ons-description-list__value ons-grid__col ons-col-10@m">Bolts &amp; Ratchets Ltd.</dd>
  </div>
  <div class="ons-description-list__item">
    <dt class="ons-description-list__term ons-grid__col ons-col-2@m">Trading as:</dt>
    <dd class="ons-description-list__value ons-grid__col ons-col-10@m">Bolts &amp; Ratchets</dd>
  </div>
  <div class="ons-description-list__item">
    <dt class="ons-description-list__term ons-grid__col ons-col-2@m">To:</dt>
    <dd class="ons-description-list__value ons-grid__col ons-col-10@m">Jacky Turner</dd>
    <dd class="ons-description-list__value ons-grid__col ons-col-10@m">Louise Goodland</dd>
  </div>
</dl>

How to use this component

A description list (<dl>) is used to divide the description list information into terms (<dt>) and descriptions (<dd>).

Use the grid system to build the layout of two columns of description list, setting the number of columns (.ons-col-<n>@m) to ensure the terms display on a single line where possible.

Use the metadataLabel to effectively describe the description list.

Help improve this page

Let us know how we could improve this page, or share your user research findings. Discuss the ‘Metadata’ component on GitHub (opens in a new tab)