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

# mds-paginator-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-paginator-item>` web component is a compound child of [`<mds-paginator>`](../mds-paginator/AGENTS.md) that renders a single clickable cell of the pagination control: either a numbered page or a navigation arrow. It has no standalone meaning and exists only to be orchestrated by its parent, which owns page state and emits the page-change event.

#### Semantic Behavior

- **Compound child only**: It is rendered exclusively by `<mds-paginator>` (one per page number plus the back/forward arrows) and is not used standalone or mixed with other child types; the parent manages count, ordering, scrolling, and selection.
- **State is parent-driven**: `selected` and `disabled` are not set by the consumer - the parent reflects them based on `currentPage` and the page boundaries, and the item only renders the resulting visual state.
- **Click reported upward**: The item carries no internal page logic; clicking it is resolved by the parent, which emits `mdsPaginatorChange`.
- **Keyboard activation**: The item is a button (`role="button"`) that Enter and Space activate, but only while it is neither `disabled` nor `selected`. A `disabled` item leaves the tab order and carries `aria-disabled="true"`; the `selected` one stays in it, as the current page (`aria-current="page"`), and ignores activation.
- **Icon vs. text rendering**: When `icon` is set the item renders an icon (used for the back/forward arrows); otherwise it renders the default slot as the page number.
- **Text-only slot**: The default slot is meant for a plain text string (a page number); HTML elements or nested components should not be placed in it.

#### Properties & Visual Configurations

This child exposes only three props, none of which a consumer normally sets directly:

- **`icon`**: Provide an icon name to turn the cell into a navigation control (the parent passes the back/forward arrows); leave it unset for a numbered page that uses the text slot instead.
- **`selected`**: Marks the cell as the current page. Set by the parent only; it switches the item to its selected visual treatment and makes it inert.
- **`disabled`**: Marks the cell as unavailable (e.g. the back arrow on page 1, the forward arrow on the last page). Set by the parent only; it blocks activation and applies the disabled styling.

Visual appearance (size, radius, colors, shadows for the default, hover, selected, and disabled states) is set through the `--mds-paginator-item-*` CSS custom properties listed in [`AGENTS.md`](AGENTS.md) rather than through props. The items live in the shadow DOM of `mds-paginator`, so set them on the paginator (or a parent selector): the items inherit them.

## 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-paginator-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 |
| --- | --- | --- | --- | --- |
| `disabled` | `disabled` | `boolean \| undefined` | - | Specifies if the item is disabled or not, is handled from the parent paginator |
| `icon` | `icon` | `string \| undefined` | - | Specifies the icon used inside the paginator item |
| `selected` | `selected` | `boolean \| undefined` | - | Specifies if the item is selected or not, is handled from the parent paginator |

## Slots

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

## CSS custom properties

| Property | Description |
| --- | --- |
| `--mds-paginator-item-background` | Sets the background-color of the item |
| `--mds-paginator-item-color` | Sets the text color of the component |
| `--mds-paginator-item-radius` | Sets the border-radius of the component |
| `--mds-paginator-item-shadow` | Sets the box-shadow of the component |
| `--mds-paginator-item-size` | Sets the height and the min-width of the paginator item |

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

## Dependencies

Uses: `mds-icon`, `mds-text`.
Used by: `mds-paginator`.
