<!--
  GENERATED FILE - do not edit by hand.
  Source of truth: src/components/mds-list-item/ in the magma monorepo (usage/*.md and the
  component's JSDoc). Regenerated on every stencil build (scripts/component-docs.ts).
-->

# mds-list-item

> `@maggioli-design-system/magma` 2.15.0. Shadow DOM: style it only through the public CSS custom properties and the parts below.

The `<mds-list-item>` web component is the single entry of a Magma list, designed to be slotted exclusively inside its parent [`<mds-list>`](../mds-list/AGENTS.md). It plays the role of a native `<li>`, pairing a leading icon with a text string so that the parent `<mds-list>` can present a coherent, accessible list.

#### Semantic Behavior

- **Compound child only**: Must be placed as a direct default-slot child of `<mds-list>`; it is not used standalone or mixed with other element types.
- **Leading icon is always present**: The component renders an icon before its text; when no `icon` is supplied it falls back to a built-in list-dot glyph, which is decorative.
- **Text-only default slot**: The default slot is intended for a plain text string; adding HTML elements or other components here is discouraged.
- **Inherited text colour**: The item sets no colour of its own: its text and its leading icon take the colour of the container, as `<mds-text>` does, so a list reads like the paragraphs around it and follows a container that sets its own colour (a tinted card, a banner). For a secondary list, set the muted role on `<mds-list>` or on its container (`text-fg-muted`).

#### Properties & Visual Configurations

- **`typography`**: Selects the text style of the item (default `detail`), drawn from the shared typography scale; pick the value that matches the density and hierarchy of the surrounding list content.
- **`variant`**: Refines the chosen `typography` (default `info`); use `read` for long-form reading contexts and `info` for compact informational lists.
- **`icon`**: Overrides the default list-dot with a named icon when a list entry benefits from a meaningful leading glyph; leave unset to keep the standard bullet.

## Read next

- [`examples.md`](examples.md) - correct usage, from the most common case
- [`mistakes.md`](mistakes.md) - the wrong forms, each with the right one
- [Storybook](https://magma-design-system.github.io/magma/storybook/?path=/docs/ui-list-list-item--docs) - the live examples, in the published Storybook of `main`
- [`conventions.md`](../../../../agents/conventions.md), [`variants.md`](../../../../agents/variants.md), [`mistakes.md`](../../../../agents/mistakes.md) - the rules shared by every component

## Props

| Prop | Attribute | Type | Default | Description |
| --- | --- | --- | --- | --- |
| `icon` | `icon` | `string \| undefined` | - | Specifies the icon displayed in the element |
| `typography` | `typography` | `"caption" \| "detail" \| "label" \| "option" \| "paragraph" \| "tip"` | `'detail'` | Specifies the typography of the element |
| `variant` | `variant` | `"info" \| "read" \| undefined` | `'info'` | Specifies the variant for `typography` |

## Slots

| Slot | Description |
| --- | --- |
| (default) | Add `text string` to this slot, **avoid** to add `HTML elements` or `components` here. |

## Parts

| Part | Description |
| --- | --- |
| `icon` | The bullet icon before the text, the one `icon` sets |
| `text` | The text of the item, around the default slot |

## CSS custom properties

None is public: its custom property is internal and may change in any release. Style it with its props, its parts and the semantic roles.

## Dependencies

Uses: `mds-icon`, `mds-text`.
