ListItem
ListItem is a Button extension with richer content layout, suitable for interactive list entries and action rows.
Anatomy
| Element | Part | Selector |
|---|---|---|
<component> | root | [data-scope="item"][data-part="root"]LMBCopy |
<Icon> | leadingconditional | [data-scope="item"][data-part="leading"]LMBCopy |
<span> | main | [data-scope="item"][data-part="main"]LMBCopy |
<span> | headerconditional | [data-scope="item"][data-part="header"]LMBCopy |
<span> | titleconditional | [data-scope="item"][data-part="title"]LMBCopy |
<span> | descriptionconditional | [data-scope="item"][data-part="description"]LMBCopy |
<span> | footerconditional | [data-scope="item"][data-part="footer"] |
<Icon> | trailingconditional | [data-scope="item"][data-part="trailing"]LMBCopy |
Props
| Name | Description | Default | Control |
|---|---|---|---|
shapeOptional | The shape of the button. roundedsquare | undefined | |
hrefOptional | The href attribute. If provided, the button will be rendered as an anchor element. string | undefined | undefined | |
leadingIconOptional | Name of the leading icon. string | undefined | undefined | |
trailingIconOptional | Name of the trailing icon. string | undefined | undefined | |
disabledOptional | Whether the button is disabled. boolean | undefined | undefined | |
activeOptional | Highlight the item as active/selected. boolean | undefined | false | |
titleOptional | Fallback title when default slot is not provided. string | undefined | undefined | |
descriptionOptional | Fallback description when description slot is not provided. string | undefined | undefined |
Events0
No events documented.
Slots6
| Name | Parameters | Description |
|---|---|---|
header | - | Optional content above the main row. |
leading | - | Optional leading content. |
default | - | Main title content. |
description | - | Optional description below the title. |
trailing | - | Optional trailing content. |
footer | - | Optional content below the main row. |
Styling20
| Token | Description |
|---|---|
--md-item-active-icon-colorColorFallback var(--md-sys-color-on-secondary-container) | Controls active icon color. |
--md-item-active-indicator-colorColorFallback var(--md-sys-color-secondary-container) | Controls active indicator color. |
--md-item-active-label-colorColorFallback var(--md-sys-color-on-secondary-container) | Controls active label color. |
--md-item-active-state-layer-colorStateFallback var(--md-sys-color-on-secondary-container) | Controls active state layer color. |
--md-item-content-gapLayoutFallback --dp(2) | Controls content gap. |
--md-item-footer-colorColorFallback var(--md-sys-color-on-surface-variant) | Controls footer color. |
--md-item-gapLayoutFallback --dp(12) | Controls gap. |
--md-item-header-colorColorFallback var(--md-sys-color-on-surface-variant) | Controls header color. |
--md-item-icon-sizeLayoutFallback --dp(20) | Controls icon size. |
--md-item-inactive-icon-colorColorFallback var(--md-color-on-container) | Controls inactive icon color. |
--md-item-inactive-label-colorColorFallback var(--md-color-on-container) | Controls inactive label color. |
--md-item-inactive-state-layer-colorStateFallback var(--md-color-on-container) | Controls inactive state layer color. |
--md-item-indicator-collapsed-visual-widthLayoutFallback --dp(12) | Controls indicator collapsed visual width. |
--md-item-indicator-shapeShapeFallback var(--md-shape-indicator) | Controls indicator shape. |
--md-item-main-padding-blockLayoutFallback --dp(8) | Controls main padding block. |
--md-item-main-padding-inlineLayoutFallback --dp(12) | Controls main padding inline. |
--md-item-min-heightLayoutFallback --dp(56) | Controls min height. |
--md-item-motionMotionFallback var(--md-easing-spatial) | Controls motion. |
--md-item-padding-blockLayoutFallback --dp(8) | Controls padding block. |
--md-item-padding-inlineLayoutFallback --dp(8) | Controls padding inline. |
Examples
Default
List
Compositions
Vue Router
When ListItem is acting as navigation, use RouterLink custom and feed its href and navigate into the component.