{
  "timestamp": "2026-11-19T09:33:56",
  "compiler": {
    "name": "@stencil/core",
    "version": "4.45.4",
    "typescriptVersion": "5.8.3"
  },
  "storybook": "https://magma-design-system.github.io/magma/storybook/",
  "studio": "https://magma-design-system.github.io/magma/studio/",
  "components": [
    {
      "filePath": "src/components/mds-breadcrumb-item/mds-breadcrumb-item.tsx",
      "encapsulation": "shadow",
      "tag": "mds-breadcrumb-item",
      "docs": "This is a web-component from Maggioli Design System [Magma](https://magma.maggiolicloud.it), built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScript framework you are using.",
      "docsTags": [
        {
          "name": "part",
          "text": "button - The `mds-button` of the item, which shows its `label`"
        },
        {
          "name": "parent",
          "text": "mds-breadcrumb"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-breadcrumb-item>` web component represents a single navigable depth in a breadcrumb trail. It is a compound child of [`<mds-breadcrumb>`](../mds-breadcrumb/AGENTS.md) and renders a clickable label followed by a separator arrow.\n\n#### Semantic Behavior\n\n- **Compound child only**: Must be placed as a direct default-slot child of `<mds-breadcrumb>`; it is not used standalone and the parent's slot should contain only `mds-breadcrumb-item` elements, not mixed child types.\n- **Selection is parent-orchestrated**: Clicking the item emits `mdsBreadcrumbItemSelect` with `{ id, selected }`; the parent then marks the matching item selected and clears the others, so only one item is selected at a time.\n- **Selected item is the current page**: While `selected` is true the item ignores pointer clicks and keyboard activation, and its button carries `aria-current=\"page\"`. Non-selected items remain clickable.\n- **Keyboard activation**: The item responds to Enter and Space in addition to pointer clicks.\n- **Decorative separator**: The trailing arrow is decorative and carries no semantic meaning.\n\n#### Properties & Visual Configurations\n\nThis child exposes essentially no visual configuration of its own - appearance is inherited from `<mds-breadcrumb>` and the shared button system, and it has no public CSS custom property: styling overrides are done through its `button` part, the item's `<mds-button>`, with the public `--mds-button-*` custom properties.\n\n- **`label`**: The item's visible text. This is the only way to set the text - the component renders it through an internal `<mds-button>` and exposes no default slot. It matches the `label` prop convention used across Magma components.\n- **`selected`**: Marks this item as the current depth. In normal use you set it on at most one item as the initial state; thereafter the parent manages it in response to navigation. Use it only to seed which depth is active on first render.\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-breadcrumb-item>` component, ordered from most common to most specialized. The examples assume a working knowledge of the shared component rules in [`agents/conventions.md`](../../../../agents/conventions.md).\n\n#### Basic Breadcrumb Trail\n\nThe canonical form. Place `<mds-breadcrumb-item>` elements as direct children of [`<mds-breadcrumb>`](../mds-breadcrumb/AGENTS.md). Use the `label` prop for each step's text.\n\n```html\n<mds-breadcrumb>\n  <mds-breadcrumb-item label=\"Home\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Archivio\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Dettaglio documento\"></mds-breadcrumb-item>\n</mds-breadcrumb>\n```\n\n#### Seeding the Active Depth with `selected`\n\nSet `selected` on the item that represents the user's current location on first render. The parent [`<mds-breadcrumb>`](../mds-breadcrumb/AGENTS.md) takes over selection management after that; do not set `selected` on more than one item at a time.\n\n```html\n<mds-breadcrumb>\n  <mds-breadcrumb-item label=\"Home\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Archivio\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Documenti\" selected></mds-breadcrumb-item>\n</mds-breadcrumb>\n```\n\n#### Listening for Navigation Changes\n\nListen to `mdsBreadcrumbItemSelect` on the item, or to `mdsBreadcrumbChange`, which the parent [`<mds-breadcrumb>`](../mds-breadcrumb/AGENTS.md) emits after updating the selection, to react when the user navigates to a different depth.\n\n```html\n<mds-breadcrumb id=\"nav\">\n  <mds-breadcrumb-item label=\"Home\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Pratiche\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Dettaglio\" selected></mds-breadcrumb-item>\n</mds-breadcrumb>\n\n<script>\n  document.querySelector('#nav').addEventListener('mdsBreadcrumbChange', (e) => {\n    console.log('profondita selezionata:', e.detail.id);\n  });\n</script>\n```\n\n#### Styling the Arrow Separator\n\n`mds-breadcrumb-item` has no public CSS custom property, and the separator icon exposes no part: it takes the subtle text color of the theme, so it keeps working in dark mode and high-contrast modes with no override. Restyle the button of the item instead, through its `button` part.\n\n#### Styling Button States\n\nRestyle the button through the `button` part: it is the item's `<mds-button>`, so it takes the public `--mds-button-*` custom properties. Target the hover state with `:hover` on the part and the selected one with the item's `selected` attribute, and use semantic color roles wrapped in `rgb(var(--magma-<role>))` so dark mode keeps working.\n\n```css\n.sidebar-nav mds-breadcrumb-item::part(button) {\n  --mds-button-color: rgb(var(--magma-text-muted));\n}\n.sidebar-nav mds-breadcrumb-item::part(button):hover {\n  --mds-button-color: rgb(var(--magma-text-default));\n}\n.sidebar-nav mds-breadcrumb-item[selected]::part(button) {\n  --mds-button-background: rgb(var(--magma-accent-surface-subtle));\n  --mds-button-color: rgb(var(--magma-accent-fg));\n}\n```\n\n#### Styling the Internal Button via `::part(button)`\n\nThe internal `<mds-button>` is exposed as `::part(button)`. Use it for what the item does not expose - for example to adjust padding or border radius for a product-specific surface.\n\n```css\n.compact-nav mds-breadcrumb-item::part(button) {\n  --mds-button-radius: var(--magma-radius-sm);\n}\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-breadcrumb-item>`. Each entry pairs the wrong form with the right one and a one-line reason. System-wide rules (boolean-as-string, shadow piercing, Tailwind color utilities, raw native event listening) live in [`agents/mistakes.md`](../../../../agents/mistakes.md) - they apply here too but are not repeated.\n\n#### Do Not Use Outside `<mds-breadcrumb>`\n\n`<mds-breadcrumb-item>` is a compound child; it communicates with its parent through internal events and relies on the parent to assign IDs, manage selection, and control the back button. Outside the parent it renders an isolated button with no selection management.\n\n```html\n<!-- INCORRECT -->\n<nav>\n  <mds-breadcrumb-item label=\"Home\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Archivio\"></mds-breadcrumb-item>\n</nav>\n\n<!-- CORRECT -->\n<mds-breadcrumb>\n  <mds-breadcrumb-item label=\"Home\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Archivio\"></mds-breadcrumb-item>\n</mds-breadcrumb>\n```\n\n#### Do Not Pass Text or HTML as Children\n\n`<mds-breadcrumb-item>` has no default slot - it renders its text through an internal `<mds-button>` driven by the `label` prop. Anything placed between the tags (plain text or HTML) is ignored and never rendered. Always use the `label` prop.\n\n```html\n<!-- INCORRECT -->\n<mds-breadcrumb-item>Dettaglio</mds-breadcrumb-item>\n<mds-breadcrumb-item><strong>Dettaglio</strong></mds-breadcrumb-item>\n\n<!-- CORRECT -->\n<mds-breadcrumb-item label=\"Dettaglio\"></mds-breadcrumb-item>\n```\n\n#### Do Not Select More Than One Item at Initialisation\n\n`selected` should be set on at most one item as the initial active depth. Marking multiple items selected puts the breadcrumb in an inconsistent state that the parent cannot resolve until the next click.\n\n```html\n<!-- INCORRECT -->\n<mds-breadcrumb>\n  <mds-breadcrumb-item label=\"Home\" selected></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Archivio\" selected></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Dettaglio\"></mds-breadcrumb-item>\n</mds-breadcrumb>\n\n<!-- CORRECT -->\n<mds-breadcrumb>\n  <mds-breadcrumb-item label=\"Home\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Archivio\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Dettaglio\" selected></mds-breadcrumb-item>\n</mds-breadcrumb>\n```\n\n#### Do Not Set `selected=\"false\"` to Deselect\n\n`selected` is a boolean attribute. Stencil reads the string `\"false\"` as `false`, but the attribute stays on the element: the item keeps the selected styling and ignores pointer clicks (`:host([selected])`), and the parent's `[selected]` query still counts it. Remove the attribute entirely to deselect.\n\n```html\n<!-- INCORRECT -->\n<mds-breadcrumb-item label=\"Home\" selected=\"false\"></mds-breadcrumb-item>\n\n<!-- CORRECT -->\n<mds-breadcrumb-item label=\"Home\"></mds-breadcrumb-item>\n```\n\n#### Do Not Listen for Native `click` to Track Navigation\n\nThe component emits `mdsBreadcrumbItemSelect` when a step is activated and the parent emits `mdsBreadcrumbChange`. A native `click` carries no depth, and it fires even on the already-selected (inert) item and on the separator arrow.\n\n```html\n<!-- INCORRECT -->\n<script>\n  document.querySelector('mds-breadcrumb-item').addEventListener('click', (e) => {\n    // no depth in the event; fires even on the selected/inert item\n  });\n</script>\n\n<!-- CORRECT -->\n<script>\n  document.querySelector('mds-breadcrumb').addEventListener('mdsBreadcrumbChange', (e) => {\n    console.log('nuovo passo attivo:', e.detail.id);\n  });\n</script>\n```\n\n#### Do Not Pierce Shadow DOM to Style Internals\n\n`mds-breadcrumb-item` has no public CSS custom property: the supported customization surface is the `::part(button)` export, the item's `<mds-button>` with its public `--mds-button-*` custom properties. The separator icon follows the theme. Targeting internal classes directly couples your code to the shadow DOM implementation and will break on minor releases.\n\n```css\n/* INCORRECT */\nmds-breadcrumb-item >>> .icon {\n  fill: red;\n}\n\n/* CORRECT */\nmds-breadcrumb-item::part(button) {\n  --mds-button-color: rgb(var(--magma-accent-fg));\n}\n```\n"
      },
      "props": [
        {
          "name": "label",
          "type": "string | undefined",
          "complexType": {
            "original": "string",
            "resolved": "string | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "label",
          "reflectToAttr": true,
          "docs": "Sets the label of the breadcrumb item",
          "docsTags": [],
          "values": [
            {
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "selected",
          "type": "boolean | undefined",
          "complexType": {
            "original": "boolean",
            "resolved": "boolean | undefined",
            "references": {}
          },
          "mutable": true,
          "attr": "selected",
          "reflectToAttr": true,
          "docs": "Choose if the component is selected or not",
          "docsTags": [],
          "values": [
            {
              "type": "boolean"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        }
      ],
      "methods": [],
      "events": [
        {
          "event": "mdsBreadcrumbItemSelect",
          "detail": "MdsBreadcrumbItemEventDetail",
          "bubbles": true,
          "complexType": {
            "original": "MdsBreadcrumbItemEventDetail",
            "resolved": "MdsBreadcrumbItemEventDetail",
            "references": {
              "MdsBreadcrumbItemEventDetail": {
                "location": "import",
                "path": "./meta/event-detail",
                "id": "src/components/mds-breadcrumb-item/meta/event-detail.ts::MdsBreadcrumbItemEventDetail",
                "referenceLocation": "MdsBreadcrumbItemEventDetail"
              }
            }
          },
          "cancelable": true,
          "composed": true,
          "docs": "Emits when the breadcrumb is active",
          "docsTags": []
        }
      ],
      "listeners": [],
      "styles": [
        {
          "name": "--mds-breadcrumb-item-arrow-depth-color",
          "annotation": "prop",
          "docs": "Sets the color of the arrow icon that separates buttons",
          "visibility": "internal"
        },
        {
          "name": "--mds-breadcrumb-item-button-background",
          "annotation": "prop",
          "docs": "Sets the background color of the button",
          "visibility": "internal"
        },
        {
          "name": "--mds-breadcrumb-item-button-background-hover",
          "annotation": "prop",
          "docs": "Sets the background color of the button when the mouse is over it",
          "visibility": "internal"
        },
        {
          "name": "--mds-breadcrumb-item-button-background-selected",
          "annotation": "prop",
          "docs": "Sets the background color of the button when it's active",
          "visibility": "internal"
        },
        {
          "name": "--mds-breadcrumb-item-button-color",
          "annotation": "prop",
          "docs": "Sets the text color of the button",
          "visibility": "internal"
        },
        {
          "name": "--mds-breadcrumb-item-button-color-hover",
          "annotation": "prop",
          "docs": "Sets the text color of the button when the mouse is over it",
          "visibility": "internal"
        },
        {
          "name": "--mds-breadcrumb-item-button-color-selected",
          "annotation": "prop",
          "docs": "Sets the text color of the button when it's active",
          "visibility": "internal"
        }
      ],
      "slots": [],
      "parts": [
        {
          "name": "button",
          "docs": "The `mds-button` of the item, which shows its `label`"
        }
      ],
      "states": [],
      "dependents": [],
      "dependencies": [
        "mds-button"
      ],
      "dependencyGraph": {
        "mds-breadcrumb-item": [
          "mds-button"
        ],
        "mds-button": [
          "mds-icon",
          "mds-spinner",
          "mds-text"
        ]
      },
      "storybook": "ui-breadcrumb-breadcrumb-item--docs"
    }
  ]
}
