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

# mds-accordion-timer-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-accordion-timer-item>` web component is the single collapsible panel of a timed, auto-advancing accordion, designed to live exclusively inside its parent [`<mds-accordion-timer>`](../mds-accordion-timer/AGENTS.md). It renders a header button paired with a progress bar and a region that reveals the slotted content while the item is selected.

#### Semantic Behavior

- **Compound child only**: Must be placed as a direct default-slot child of `<mds-accordion-timer>`, alongside other `<mds-accordion-timer-item>` siblings. It is not used standalone or mixed with other child types, since the parent drives the rotating timer across the items.
- **Selection is parent-orchestrated**: `selected` represents the open state, but only one sibling is open at a time - the parent advances selection on the timer or on a user click.
- **Click reports up**: Clicking the header of a closed item emits `mdsAccordionTimerItemClickSelect`, and the parent opens it, pauses and re-anchors its timer on it. Clicking the open item does nothing: it stays open.
- **Programmatic selection**: Setting `selected` to `true` emits `mdsAccordionTimerItemSelect`, and the parent restarts the countdown from the beginning of that item. A click reaches `selected` through the parent, so it emits this event as well, which the parent does not take as a second selection.
- **Hover pauses the countdown**: While selected, pointer enter/leave emit `mdsAccordionTimerItemMouseEnterSelect` / `mdsAccordionTimerItemMouseLeaveSelect`, which the parent uses to pause and resume the timer. These fire only when the item is currently selected.

#### Properties & Visual Configurations

- **`description`** (required): the title text shown on the header in both open and closed states; it also supplies the accessible label of the content region.
- **`typography`**: picks the title style of the header text, defaulting to `h5`. An item is a part of the page, styled as `h6` (`titles/part` of the design language): write `typography="h6"` until the default moves with the next major (#1218). The value is a style only: the header is a `<span>` inside the `<button>` that opens the item, whatever its style.
- **`tag`**: puts the title in the outline of the page, at the level of its place: `tag="h3"` under a section titled `h2`. The heading wraps the button, as the Accordion pattern of the WAI-ARIA Authoring Practices does. Left out, the item is not a heading: the component cannot know its place, and the level of its style (`h6`) would skip the levels in between.
- **`selected`**: marks this item as the open one. You normally set it on a single item to define the initial open panel; thereafter the parent owns it.
- **`duration`**: an optional per-item override (in ms) for how long this item stays open before the parent auto-advances, overriding the parent's global `duration` for this item only.
- **`progress`** and **`uuid`** are managed by the parent at runtime; do not set them manually.

## 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-accordion-timer-accordion-timer-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 |
| --- | --- | --- | --- | --- |
| `description` | `description` | `string` | - | **Required**. Specifies the title shown when the accordion is closed or opened |
| `duration` | `duration` | `number \| undefined` | - | Specifies the duration of the single component when selected, it overrides the global duration of itself only |
| `progress` | `progress` | `number` | `0` | The progress of the item's countdown, from 0 to 1: mds-accordion-timer writes it while the item is selected and sets it back to 0 when the next item takes over |
| `selected` | `selected` | `boolean` | `false` | Specifies if the accordion item is opened or not |
| `tag` | `tag` | `"h1" \| "h2" \| "h3" \| "h4" \| "h5" \| "h6" \| undefined` | - | Specifies the heading level of the title, the level of its place in the outline of the page (`h3` under a section titled `h2`): the heading wraps the button that opens the item, as the Accordion pattern of the WAI-ARIA Authoring Practices does. Left out, the item is not a heading: only the page knows its place, and the level of the style would skip the levels in between |
| `typography` | `typography` | `"action" \| "h1" \| "h2" \| "h3" \| "h4" \| "h5" \| "h6"` | `'h5'` | Specifies the typography of the title. An item is a part of the page, whose title is styled as `h6` (`titles/part`, #1189): write `h6` until the default moves with the next major (#1218). It is the style only: the level of the title in the outline is `tag` |
| `uuid` | `uuid` | `number` | `0` | Used automatically by MdsAccordionTimer wrapper to handle it's siblings |

## Events

| Event | Detail | Description |
| --- | --- | --- |
| `mdsAccordionTimerItemClickSelect` | `MdsAccordionTimerItemEventDetail` | Emits when the accordion is clicked by the mouse |
| `mdsAccordionTimerItemMouseEnterSelect` | `MdsAccordionTimerItemEventDetail` | Emits when the accordion is hovered by the mouse |
| `mdsAccordionTimerItemMouseLeaveSelect` | `MdsAccordionTimerItemEventDetail` | Emits when the accordion is hovered by the mouse |
| `mdsAccordionTimerItemSelect` | `MdsAccordionTimerItemEventDetail` | Emits when the accordion is changed from code |

## Slots

| Slot | Description |
| --- | --- |
| (default) | Add content like `text string`, `HTML elements` or `components` to this slot |

## Parts

| Part | Description |
| --- | --- |
| `content` | the content wrapper of the `default` slot |
| `icon` | The arrow icon of the component |
| `label` | The text label of the component |
| `progress` | The progress bar of the component |

## CSS custom properties

| Property | Description |
| --- | --- |
| `--mds-accordion-timer-item-color` | Sets the text color of the component |

Only these are public. Its other 4 are internal: they may change in any release, do not set them.

## Dependencies

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