Skip to main content

List

The List component provides ordered and unordered list elements with consistent styling.

Installation

yarn add @twilio-paste/list

Usage

Unordered List

import { UnorderedList, ListItem } from '@twilio-paste/list';

<UnorderedList>
  <ListItem>First item</ListItem>
  <ListItem>Second item</ListItem>
  <ListItem>Third item</ListItem>
</UnorderedList>

Ordered List

import { OrderedList, ListItem } from '@twilio-paste/list';

<OrderedList>
  <ListItem>First item</ListItem>
  <ListItem>Second item</ListItem>
  <ListItem>Third item</ListItem>
</OrderedList>

Ordered Display List

import { OrderedDisplayList, OrderedDisplayListItem, OrderedDisplayListHeading } from '@twilio-paste/list';

<OrderedDisplayList variant="heading20">
  <OrderedDisplayListItem>
    <OrderedDisplayListHeading>Step 1</OrderedDisplayListHeading>
    Complete the first task
  </OrderedDisplayListItem>
  <OrderedDisplayListItem>
    <OrderedDisplayListHeading>Step 2</OrderedDisplayListHeading>
    Complete the second task
  </OrderedDisplayListItem>
</OrderedDisplayList>

Props

List (Base)

as
'ol' | 'ul'
required
The HTML element type to render.
element
string
default:"LIST"
Overrides the default element name to apply unique styles with the Customization Provider.
listStyleType
ListStyleType
Sets the list-style-type of the list. This is a shorthand for the CSS property.
marginTop
Space
Sets the top margin spacing.
marginBottom
Space
Sets the bottom margin spacing.

ListItem

element
string
default:"LIST_ITEM"
Overrides the default element name to apply unique styles with the Customization Provider.

OrderedDisplayList

variant
'heading20' | 'heading30' | 'heading40' | 'heading50' | 'heading60'
Sets the heading variant for the ordered display list.

OrderedDisplayListHeading

element
string
default:"ORDERED_DISPLAY_LIST_HEADING"
Overrides the default element name to apply unique styles with the Customization Provider.
as
HeadingProps['as']
The HTML heading element to render.

Build docs developers (and LLMs) love