Skip to content
Change the site theme
Figma
(information)

Description List

Peer review pending

A Description List is a set or sets of terms and their definitions, or details, used to display data.


Guidelines

Guidelines page anchor

A Description List is a set or sets of terms and their definitions, or details, used to display data.

About Description List

About Description List page anchor

The Description List package consists of DescriptionList itself, plus DescriptionListSet, DescriptionListTerm, and DescriptionListDetails. The DescriptionList should wrap the other elements, and its children should always follow the order of term, details, term, details, each of the term-details pairs inside of a set. It's okay for multiple terms to correlate to a single detail, and for multiple details to correlate to a single term. As long as they're in the proper order, and nested inside of their unique sets, the term-details association will be clear. If you have a term without details, be sure to include either the empty state of the details tag (<DescriptionListDetails />) or a symbol to indicate the empty state such as -.

Accessibility

Accessibility page anchor

Description List is a <dl>, Description List Term is a <dt>, and Description List Details is a <dd>. Assistive technology isn't perfect when it comes to reading Description Lists. In order to best support screen readers and other ATs, be sure to follow best practices for building accessible Description Lists. They must only contain properly-ordered Description Terms and Description Details. If the children are out of order, the screen readers will have trouble conveying the intended meaning to the user.

If any of your terms are missing details, or vice versa, be sure to still include the empty tag. This will communicate to ATs that the value is empty, rather than assuming it's paired with the next existing term/details. If, in your Description List, you have a term with 2 details, or 2 terms that apply to the same detail, list them in order and don't include empty tags to follow the term-details pattern. See the examples below for more guidance.

Use a basic Description List for conveying small, static bits of data.

Description List with Icon

Description List with Icon page anchor

The Description List can be used with Status Pattern.

Description List with multiple Terms

Description List with multiple Terms page anchor

Sometimes you'll need to pair multiple terms with a single detail. Use this example for guidance.

Description List with multiple Details

Description List with multiple Details page anchor

Sometimes you'll need to pair multiple details with a single term. Use this example for guidance.

Description List with empty state

Description List with empty state page anchor

If one of your details is missing, indicate the empty state by using an empty tag (<DescriptionListDetails />) or using a symbol such as -.

Be sure to include text in each term. The content of a term should not be a standalone icon or other visual element.

Terms are paired with details based on their order within the Description List. If a Description List Term has an empty Description List Details, be sure to still include an empty details tag or a - to signify the empty state. In the example below, the email address value is paired with both terms - Phone Number and Email.

<DescriptionList>
<DescriptionListSet>
<DescriptionListTerm>Phone Number</DescriptionListTerm>
<DescriptionListTerm>Email</DescriptionListTerm>
<DescriptionListDetails>twilion@twilio.com</DescriptionListDetails>
</DescriptionListSet>
</DescriptionList>

Instead, include an empty tag (or a symbol, such as -) to signify the empty state of a given term, and separate out the sets:

<DescriptionList>
<DescriptionListSet>
<DescriptionListTerm>Phone Number</DescriptionListTerm>
<DescriptionListDetails />
</DescriptionListSet>
<DescriptionListSet>
<DescriptionListTerm>Email</DescriptionListTerm>
<DescriptionListDetails>twilion@twilio.com</DescriptionListDetails>
</DescriptionListSet>
</DescriptionList>

When to use Description List

When to use Description List page anchor
Do

Use a <DescriptionListSet> to wrap your set of Term and Details within the Description List for extra separation and control.

Don't

Don't use any other type of HTML element as children of the Description List (besides DescriptionListSet, DescriptionListTerm, DescriptionListDetails, or <div>).

Do

Use Description List for small amounts of data.

Don't

Don't use for interactive data, form controls, or data sets. Consider using Table or Data Grid, especially if you want columns or column headers.

Do

Use flow content as children to Description Term and Description Details.

Don't

Don’t use headers or footers as children to Description Term or Description Details.


yarn add @twilio-paste/description-list - or - yarn add @twilio-paste/core
import {DescriptionList, DescriptionListSet, DescriptionListTerm, DescriptionListDetails} from '@twilio-paste/core/description-list';
const Component = () => (
<DescriptionList>
<DescriptionListSet>
<DescriptionListTerm>Paste</DescriptionList>
<DescriptionListDetails>A design system used to build accessible, cohesive, and high-quality customer experiences at Twilio.</DescriptionListDetails>
</DescriptionListSet>
</DescriptionList>
);

All the valid attributes for <dl> are supported including the following props:

PropTypeDescriptionDefault
children?DescriptionListTerm, DescriptionListDetails, <div>null
element?stringOverrides the default element name to apply unique styles with the Customization Provider'DESCRIPTION_LIST'

Description List Set Props

Description List Set Props page anchor

All the valid attributes for <div> are supported including the following props:

PropTypeDescriptionDefault
children?DescriptionListTerm, DescriptionListDetailsnull
element?stringOverrides the default element name to apply unique styles with the Customization Provider'DESCRIPTION_LIST'

Description List Term Props

Description List Term Props page anchor

All the valid attributes for <dt> are supported including the following props:

PropTypeDescriptionDefault
children?React.ReactNodenull
element?stringOverrides the default element name to apply unique styles with the Customization Provider'DESCRIPTION_LIST_TERM'

Description List Details Props

Description List Details Props page anchor

All the valid attributes for <dd> are supported including the following props:

PropTypeDescriptionDefault
children?React.ReactNodenull
element?stringOverrides the default element name to apply unique styles with the Customization Provider'DESCRIPTION_LIST_DETAILS'

Black lives matter.