ListItem (Web)
One row in a list, with a title, a subtitle and an optional decoration. Use for a tappable list of items.
Health
Source
Design
Storybook
Playground
No Example
Accessibility
partially-compliant
Platform
Web
Accessibility issues
This component does not support being used as a link. If you need to use it as a link, you can wrap it in a <A>. Do not use the `onClick` prop when using it with a link.
- Overview
- Props
- Figma
ListItem props
| Name | Type | Default Value | Description | Usage count |
|---|---|---|---|---|
| buttonType | "button""submit""reset"undefined | undefined | The type of button to use for the underlying HTML button. TODO: there are very few cases where "submit" is the right choice but it's the HTML default when we're rendering inside a <form>. We should switch to "button" by default after checking it doesn't break anything. | |
| children | ReactNode | Enables right side customization | ||
| decorProps | DecorPropsundefined | |||
| errors | ReactNode[]undefined | |||
| hideCaret | booleanundefined | When `onClick` is filled, caret is shown by default. You can disable it with this prop. | ||
| onClick | 2 possibilitiesundefined(event: MouseEvent<Element, MouseEvent>) => void | |||
| style | CSSPropertiesundefined | |||
| subtitle | ReactNode | |||
| title | ReactNode | |||
| variant | ListItemVariantundefined |
Deprecated props
| Name | Type | Default Value | Description | Usage count |
|---|---|---|---|---|
| optionProps | ListItemOptionPropsundefined | use children instead |