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

# mds-zero

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

The `<mds-zero>` web component is the empty-state (zero-data) panel of the Magma Design System: a centered, vertically stacked layout that pairs an illustration, explanatory copy, and a call-to-action to guide users when a list, search, or section has no content to show. It is a pure structural container with no props - composition happens entirely through its slots.

#### Semantic Behavior

- **Three-zone layout**: The host stacks its content vertically and centered - the default slot (the visual) on top, the `content` zone in the middle, and the `action` zone in a footer at the bottom - with `--magma-rhythm-content-actions` (600) between the zones.
- **One inset, shared by the zones**: The host pads its zones once, with `--magma-rhythm-inset` (600) on every side, the inset of a container of a part (`rhythm/inset`, `rhythm/shared-inset` in the design language). With no action the footer takes no room, so the inset stays the same at the bottom.
- **Default slot is the visual**: The unnamed default slot holds the illustration or image; it is meant for an `mds-img`/`img`, not text.
- **Content zone is centered text**: The `content` slot is centered, constrained by a max-width, and sets its children `--magma-rhythm-title-content` (300) apart, so a title and its description read as one message with no wrapper of yours (`rhythm/title-content`).
- **Action zone auto-centers children**: Elements placed in `slot="action"` are horizontally centered within the footer, `--magma-rhythm-inline` (300) apart, so a single primary button sits centered by default.
- **A muted surface**: The host paints `--magma-surface-muted`, a step under the page in light and in dark, on the plane where the items would stand; it needs no dark correction, and it picks up the contrast (a ring) and reduced-motion preferences.

#### Properties & Visual Configurations

`<mds-zero>` exposes no props; all configuration is done through slot composition and one CSS custom property.

- **`content` vs. `action` slots**: Put the message in `slot="content"`: a title by its role, `mds-text typography="part"` with the `tag` of its place in the outline (`h2` under the title of the page, `h3` in a section, `h1` with `typography="page"` when the panel takes the place of the page), then the description in `typography="detail"`. Put the recovery action (typically a single `mds-button`) in `slot="action"`. Use the default slot only for the illustration.
- **`--mds-zero-contents-max-width`**: Caps the width of the centered text block (default `400px`) so long descriptions wrap into a balanced column rather than spanning the full panel.

The `contents` and `actions` shadow parts expose the two wrapper zones for consumers that need to override their layout from outside the shadow boundary.

## 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-zero--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

## Slots

| Slot | Description |
| --- | --- |
| (default) | Add `HTML elements` or `components` to this slot, it is **recommended** to use `mds-img` or `img` element. |
| `action` | Add `HTML elements` or `components`, it is **recommended** to use `mds-button` element. |
| `content` | Put text elements here, |

## Parts

| Part | Description |
| --- | --- |
| `actions` | Selects the wrapper of the elements with attribute `slot="action"`. |
| `contents` | Selects the wrapper of the elements with attribute `slot="content"`. |

## CSS custom properties

| Property | Description |
| --- | --- |
| `--mds-zero-contents-max-width` | Set if the contents has a max width to be centered in the component |
