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

# mds-policy-ai

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

The `<mds-policy-ai>` web component is the Magma Design System disclosure marker that flags AI-generated content as produced by MIA (Maggioli's artificial intelligence) and links to the official AI usage policy. It is a presentational compound component with no native HTML primitive, rendering one of four interchangeable surfaces (icon, chip, card, banner).

#### Semantic Behavior

- **Variant-exclusive rendering**: Exactly one surface is mounted per the `variant` value, exposed through the matching shadow part (`icon`, `chip`, `card`, `banner`).
- **Localization**: Supplies all default copy (headline, description, link labels) in `el`, `en`, `es`, `it`, resolved from the host language.
- **Policy navigation**: Every variant routes the user to the policy `href` - the `icon` variant opens it in a new tab on click, while the other variants embed a button link to it.
- **Content fallbacks**: `headline` and `description` override the localized defaults where the active variant uses them; otherwise the built-in MIA disclosure text is shown.

#### Properties & Visual Configurations

- **`variant`** selects the disclosure surface and is the primary configuration knob. Each value carries a distinct placement intent:
  - **`'chip'`** (default): a compact "Generated with MIA" chip with a hover dropdown holding the disclaimer and policy link - for inline placement next to generated text.
  - **`'icon'`**: a minimal help glyph with a tooltip - for the most space-constrained contexts.
  - **`'card'`**: a small card pairing the disclaimer with a policy button - for sidebars or standalone blocks.
  - **`'banner'`**: a full-width banner with title, description, and action - for prominent page-level notices.
- **`headline`** sets the short title used by the `chip`, `icon`, and `banner` surfaces; **`description`** sets the longer disclaimer body shown across the variants that expose it.
- **`href`** points to the AI policy page and defaults to the Maggioli EU AI-regulation article; override it to target a tenant-specific policy.

The internal surfaces are fixed to `variant="ai"` of their underlying Magma components (the chip at its default `strong` tone, the banner and the buttons at `tone="weak"`) and are not configurable from this component; the shared variant/tone ladder is documented in [`agents/variants.md`](../../../../agents/variants.md).

## 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-policy-ai--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 \| undefined` | - | Sets the description to custom component long text |
| `headline` | `headline` | `string \| undefined` | - | Sets the headline to custom component text |
| `href` | `href` | `string \| undefined` | `'https://www.maggiolieditore.it/il-regolamento-europeo-sull-intelligenza-artificiale.html'` | Sets the pointing URL of the component |
| `variant` | `variant` | `"banner" \| "card" \| "chip" \| "icon" \| undefined` | `'chip'` | Sets the variant type of the component |

## Parts

| Part | Description |
| --- | --- |
| `banner` | Selects the `banner` component wrapped in shadowDOM, will be found only if attirbute `variant` is set to `banner`. |
| `card` | Selects the `card` component wrapped in shadowDOM, will be found only if attirbute `variant` is set to `card`. |
| `chip` | Selects the `mds-chip` wrapped in shadowDOM, will be found only if attirbute `variant` is set to `chip`. |
| `chip-wrapper` | Selects the wrapper of the chip and of its dropdown, will be found only if attirbute `variant` is set to `chip`. |
| `icon` | Selects the `icon` component wrapped in shadowDOM, will be found only if attirbute `variant` is set to `icon`. |

## Dependencies

Uses: `mds-help`, `mds-text`, `mds-chip`, `mds-dropdown`, `mds-button`, `mds-icon`, `mds-banner`.
