Lists

Lists show items of text and images in a vertical column.

Three items in a list. The first item says Apple as its headline. The second one says Banana in its headline as well as Banana is a yellow fruit as its sub header. The third list item says Cucumber in its headline and Cucumbers are long green fruits that are just as long as this multi-line description as its sub header which is on two lines.

View interactive demo inline.

Open interactive demo in new tab.

<petal-list> is a container composed of <petal-list-item>s of different types.

FruitsAppleBanana
Cucumber
Cucumbers are long green fruits that are just as long as this multi-line description
Shop for Kiwis
This will link you out in a new tab
open_in_new
<petal-list style="max-width: 300px;">
  <petal-list-item>
    Fruits
  </petal-list-item>
  <petal-divider></petal-divider>
  <petal-list-item>
    Apple
</petal-list-item>
  <petal-list-item>
    Banana
  </petal-list-item>
  <petal-list-item>
    <div slot="headline">Cucumber</div>
    <div slot="supporting-text">Cucumbers are long green fruits that are just as long as this multi-line description</div>
  </petal-list-item>
  <petal-list-item
      type="link"
      href="https://google.com/search?q=buy+kiwis&tbm=shop"
      target="_blank">
    <div slot="headline">Shop for Kiwis</div>
    <div slot="supporting-text">This will link you out in a new tab</div>
    <petal-icon slot="end">open_in_new</petal-icon>
  </petal-list-item>
</petal-list>

Icons can be slotted into list-items' start or end slot.

Roselocal_floristTulipfilter_vintageDaisyspa
<petal-list style="max-width: 300px">
  <petal-list-item>
    Rose
    <petal-icon slot="start">local_florist</petal-icon>
  </petal-list-item>
  <petal-divider></petal-divider>
  <petal-list-item>
    Tulip
    <petal-icon slot="start">filter_vintage</petal-icon>
  </petal-list-item>
  <petal-divider></petal-divider>
  <petal-list-item>
    Daisy
    <petal-icon slot="start">spa</petal-icon>
  </petal-list-item>
</petal-list>

Images should be slotted into list-items' start slot.

Rose Tulip Daisy
<petal-list style="max-width: 300px;">
  <petal-list-item>
    Rose
    <img slot="start" style="width: 56px" src="rose.jpg">
  </petal-list-item>
  <petal-divider></petal-divider>
  <petal-list-item>
    Tulip
    <img slot="start" style="width: 56px" src="tulip.jpg">
  </petal-list-item>
  <petal-divider></petal-divider>
  <petal-list-item>
    Daisy
    <img slot="start" style="width: 56px" src="daisy.jpg">
  </petal-list-item>
</petal-list>

List can have its role and tabindex set via the role and tabindex attributes, and list items can have their role and tabindex set via the type and tabindex attributes respectively.

bookmark

List item has a limited set of types that can be set on it. This is to ensure that your list remains accessible with all other properties and options presented to it. See the ListItemType TypeScript type exported by list item for the current accepted values.

By default these values are set to role="list" and tabindex="-1" for list, and role="listitem" and tabindex="0" for list items.

List and List Item supports Material theming and can be customized in terms of color, typography, and shape.

TokenDefault value
--md-list-container-color--md-sys-color-surface
--md-list-item-container-shape--md-sys-shape-corner-none
--md-list-item-label-text-color--md-sys-color-on-surface
--md-list-item-supporting-text-color--md-sys-color-on-surface-variant
--md-list-item-trailing-supporting-text-color--md-sys-color-on-surface-variant
--md-list-item-label-text-font--md-sys-typescale-label-large-font
--md-list-item-supporting-text-font--md-sys-typescale-body-medium-font
--md-list-item-trailing-supporting-text-font--md-sys-typescale-label-small-font
Apple
In stock
+100
Banana
In stock
56
Cucumber
Low stock
5
<style>
  :root {
    --md-list-container-color: #f4fbfa;
    --md-list-item-label-text-color: #161d1d;
    --md-list-item-supporting-text-color: #3f4948;
    --md-list-item-trailing-supporting-text-color: #3f4948;
    --md-list-item-label-text-font: system-ui;
    --md-list-item-supporting-text-font: system-ui;
    --md-list-item-trailing-supporting-text-font: system-ui;
  }
  [slot="trailing-supporting-text"] {
    width: 30px;
    text-align: end;
  }
</style>
<petal-list>
  <petal-list-item type="button">
    <div slot="headline">Apple</div>
    <div slot="supporting-text">In stock</div>
    <div slot="trailing-supporting-text">+100</div>
  </petal-list-item>
  <petal-list-item type="button">
    <div slot="headline">Banana</div>
    <div slot="supporting-text">In stock</div>
    <div slot="trailing-supporting-text">56</div>
  </petal-list-item>
  <petal-list-item type="button">
    <div slot="headline">Cucumber</div>
    <div slot="supporting-text">Low stock</div>
    <div slot="trailing-supporting-text">5</div>
  </petal-list-item>
</petal-list>
TokenDefault value
--md-list-item-leading-icon-color--md-sys-color-on-surface-variant
--md-list-item-trailing-icon-color--md-sys-color-on-surface-variant
--md-list-item-leading-icon-size18px
--md-list-item-trailing-icon-size24px
Eggs
eggrecommend
Ice Cream
icecreamdangerous
Orange
nutritionrecommend
<style>
  :root {
    background-color: #f4fbfa;
    --md-list-container-color: #f4fbfa;
    --md-list-item-label-text-color: #161d1d;
    --md-list-item-leading-icon-color: #006a6a;
    --md-list-item-trailing-icon-color: #006a6a;
    --md-list-item-leading-icon-size: 20px;
    --md-list-item-trailing-icon-size: 20px;
  }
  petal-list-item.unhealthy {
    --md-list-item-trailing-icon-color: #ba1a1a;
  }
</style>
<petal-list>
  <petal-list-item>
    <div slot="headline">Eggs</div>
    <petal-icon slot="start">egg</petal-icon>
    <petal-icon slot="end">recommend</petal-icon>
  </petal-list-item>
  <petal-list-item class="unhealthy">
    <div slot="headline">Ice Cream</div>
    <petal-icon slot="start">icecream</petal-icon>
    <petal-icon slot="end">dangerous</petal-icon>
  </petal-list-item>
  <petal-list-item>
    <div slot="headline">Orange</div>
    <petal-icon slot="start">nutrition</petal-icon>
    <petal-icon slot="end">recommend</petal-icon>
  </petal-list-item>
</petal-list>
TokenDefault value
--md-list-item-leading-avatar-label-color--md-sys-color-on-primary-container
--md-list-item-leading-avatar-label-font--md-sys-typescale-title-medium-font
--md-list-item-leading-avatar-color--md-sys-color-primary-container
--md-list-item-leading-avatar-size40px
--md-list-item-leading-avatar-shape--md-sys-shape-corner-full
TokenDefault value
--md-list-item-leading-image-height56px
--md-list-item-leading-image-width56px
--md-list-item-leading-image-shape--md-sys-shape-corner-none
Rose
Tulip
Daisy
<style>
  :root {
    background-color: #f4fbfa;
    --md-list-container-color: #f4fbfa;
    --md-list-item-label-text-color: #161d1d;
    --md-list-item-leading-image-height: 50px;
    --md-list-item-leading-image-width: 100px;
    --md-list-item-leading-image-shape: 25px;
  }
  img {
    width: 40px;
  }
</style>
<petal-list>
  <petal-list-item headline="Rose">
    <img slot="start" src="rose-wide.jpg">
  </petal-list-item>
  <petal-list-item headline="Tulip">
    <img slot="start" src="tulip-wide.jpg">
  </petal-list-item>
  <petal-list-item headline="Daisy">
    <img slot="start" src="daisy-wide.jpg">
  </petal-list-item>
</petal-list>
PropertyAttributeTypeDefaultDescription
itemsListItem[]undefined
MethodParametersReturnsDescription
activateNextItemNoneListItemActivates the next item in the list. If at the end of the list, the first item will be activated.
activatePreviousItemNoneListItemActivates the previous item in the list. If at the start of the list, the last item will be activated.
PropertyAttributeTypeDefaultDescription
disableddisabledbooleanfalseDisables the item and makes it non-selectable and non-interactive.
typetypeListItemType'text'Sets the behavior of the list item, defaults to "text". Change to "link" or "button" for interactive items.
hrefhrefstring''Sets the underlying HTMLAnchorElement's href resource attribute.
targettarget"" | "_blank" | "_parent" | "_self" | "_top"''Sets the underlying HTMLAnchorElement's target attribute when href is set.
relrelstring''Sets the underlying HTMLAnchorElement's rel attribute when href is set.
referrerPolicyreferrerpolicystring''Sets the underlying HTMLAnchorElement's referrerpolicy attribute when href is set.
MethodParametersReturnsDescription
clickNonevoid
EventTypeBubblesComposedDescription
request-activationEventYesYesRequests the list to set tabindex=0 on the item and focus it. Used internally for list keyboard navigation; most applications do not need to listen for this event. It is exposed for authors building their own list-item replacements or wrapping items in a custom controller.
About
IntroductionQuick StartMaterial 3 ExpressiveRoadmapSupportBundle SizesDesign tokensToken update v34LicensingVisual testingReleasing
Theming
Material ThemingColorTypographyShape
Components
Button groupButtonsCheckboxChipsDialogsFloating action button (FAB)Icon ButtonsListsMenusProgress indicatorsRadioRippleSelectSlidersSwitchTabsText field