{
  "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/mds-breadcrumb.tsx",
      "encapsulation": "shadow",
      "tag": "mds-breadcrumb",
      "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": "slot",
          "text": "- Add `mds-breadcrumb-item` element/s."
        },
        {
          "name": "category",
          "text": "navigation"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-breadcrumb>` web component is the navigation-trail container of the Magma Design System. It is a compound parent that arranges a sequence of slotted `<mds-breadcrumb-item>` children into a hierarchical path and adds an optional back-navigation control.\n\n#### Semantic Behavior\n\n- **Compound parent/child**: The default slot accepts only `<mds-breadcrumb-item>` children.\n- **Selection tracking**: When the user selects a child it becomes the single current depth and the others are cleared. Setting `selected` from code emits nothing, so the parent does not react to it.\n- **Back button**: Unless `hide-back` is set the host renders a leading arrow that steps selection to the previous item; it auto-disables whenever the first item is current (or, on load, when no item is).\n- **Change event**: `mdsBreadcrumbChange` fires after any selection change - via a child click or the back arrow - carrying the new index `id` and a `caller` item: the item now selected, the clicked one or the one the back arrow steps to.\n- **Localized back button**: The back button's `title` is resolved per document language (el/en/es/it).\n\n#### Properties & Visual Configurations\n\nThis component exposes a single behavioral prop:\n\n- **`hideBack`** removes the leading arrow control. Leave it off (the default) for multi-level trails where users benefit from a one-tap step backwards; set it for shallow or display-only breadcrumbs where reverse navigation adds no value.\n\nVisual styling (item button colors, separator arrow color) is not driven by props, and `mds-breadcrumb` has no public CSS custom property: the colors follow the semantic roles of the theme, the selected item's included. To restyle the buttons, target the `button` part of the child [`mds-breadcrumb-item`](../mds-breadcrumb-item/AGENTS.md): it is the item's `<mds-button>`, so it takes the public `--mds-button-*` custom properties. The shared `variant` / `tone` / `size` ladders defined in [`agents/variants.md`](../../../../agents/variants.md) do not apply here; per-item labels and selection state live on the `<mds-breadcrumb-item>` children.\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-breadcrumb>` 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 Navigation Trail\n\nThe canonical form. Slot one `<mds-breadcrumb-item>` per level and mark the current depth with `selected`. The back arrow is shown by default.\n\n```html\n<mds-breadcrumb>\n  <mds-breadcrumb-item label=\"Home\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Archivio pratiche\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Pratica 2024/001\" selected></mds-breadcrumb-item>\n</mds-breadcrumb>\n```\n\n#### Without the Back Arrow\n\nAdd the `hide-back` attribute for display-only or shallow breadcrumbs where reverse navigation adds no value. The back arrow is shown by default, so this is an explicit opt-out.\n\n```html\n<mds-breadcrumb hide-back>\n  <mds-breadcrumb-item label=\"Impostazioni\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Profilo utente\" selected></mds-breadcrumb-item>\n</mds-breadcrumb>\n```\n\n#### Listening for Navigation Changes\n\n`mdsBreadcrumbChange` fires whenever a child item is clicked or the back arrow is activated. The detail carries the zero-based `id` string of the newly selected item and a `caller` element: the clicked item, or for the back arrow the item that was current before the step.\n\n```html\n<mds-breadcrumb id=\"nav\">\n  <mds-breadcrumb-item label=\"Dashboard\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Documenti\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Fatture\" selected></mds-breadcrumb-item>\n</mds-breadcrumb>\n\n<script>\n  document.getElementById('nav').addEventListener('mdsBreadcrumbChange', (e) => {\n    console.log('Livello selezionato:', e.detail.id);\n    console.log('Elemento:', e.detail.caller);\n  });\n</script>\n```\n\n#### Programmatic Selection\n\nSet `selected` in the markup on the item you want active on load: the parent reads it to set the back button state (disabled on the first item). Setting `selected` later from JavaScript emits no event, so the parent neither clears the other items nor updates the back button.\n\n```html\n<mds-breadcrumb>\n  <mds-breadcrumb-item label=\"Progetto Alpha\" selected></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Sprint 3\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Attivita\"></mds-breadcrumb-item>\n</mds-breadcrumb>\n```\n\n#### Item Label via `label` Prop\n\nAlways set the text with the `label` prop on `<mds-breadcrumb-item>`: the item has no slot. The prop is reflected as an HTML attribute, enabling CSS attribute selectors and framework bindings.\n\n```html\n<mds-breadcrumb>\n  <mds-breadcrumb-item label=\"Area riservata\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Gestione utenti\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Nuovo utente\" selected></mds-breadcrumb-item>\n</mds-breadcrumb>\n```\n\n#### Styling Customization via CSS Custom Properties\n\n`mds-breadcrumb` has no public CSS custom property: style it with its props, the `button` part of its items and the semantic roles. The item colors, the selected item's included, and the separator arrow follow the semantic color roles of the theme, so dark mode and high-contrast modes keep working with no override. To retheme the whole trail at once, target the `button` part of every child `<mds-breadcrumb-item>` from a parent selector: the part is the item's `<mds-button>`, so it takes the public `--mds-button-*` custom properties. Use semantic color roles wrapped in `rgb(var(--magma-<role>))`.\n\n```css\n.sidebar-nav mds-breadcrumb-item::part(button) {\n  --mds-button-color: rgb(var(--magma-accent-fg));\n}\n.sidebar-nav mds-breadcrumb-item[selected]::part(button) {\n  --mds-button-color: rgb(var(--magma-text-default));\n}\n```\n\n#### Per-Item Styling via `::part(button)`\n\nWhen you need to restyle a single item's inner button beyond what the CSS vars allow, target the documented `::part(button)` on `<mds-breadcrumb-item>`. This is the only supported shadow-part surface on the child component.\n\n```css\nmds-breadcrumb-item[selected]::part(button) {\n  font-weight: bold;\n  letter-spacing: 0.02em;\n}\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-breadcrumb>`. Each entry pairs the wrong form with the right one and a one-line reason. System-wide rules (boolean-as-string, shadow piercing, raw native event listening) live in [`agents/mistakes.md`](../../../../agents/mistakes.md) - they apply here too but are not repeated.\n\n#### Do Not Slot Raw HTML Inside `<mds-breadcrumb>`\n\nThe default slot accepts only `<mds-breadcrumb-item>` elements; slotting arbitrary HTML breaks the internal selection-tracking and back-button logic.\n\n```html\n<!-- INCORRECT -->\n<mds-breadcrumb>\n  <a href=\"/home\">Home</a>\n  <span>Archivio</span>\n  <strong>Documento corrente</strong>\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=\"Documento corrente\" selected></mds-breadcrumb-item>\n</mds-breadcrumb>\n```\n\n#### Do Not Use `<mds-breadcrumb-item>` Outside `<mds-breadcrumb>`\n\nChild items rely on the parent for an ID when they have none and for selection-state management. Rendered standalone they get no back button, no sibling deselection and no `mdsBreadcrumbChange`.\n\n```html\n<!-- INCORRECT -->\n<div class=\"my-nav\">\n  <mds-breadcrumb-item label=\"Home\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Sezione\" selected></mds-breadcrumb-item>\n</div>\n\n<!-- CORRECT -->\n<mds-breadcrumb>\n  <mds-breadcrumb-item label=\"Home\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Sezione\" selected></mds-breadcrumb-item>\n</mds-breadcrumb>\n```\n\n#### Do Not Pass Text or HTML as `<mds-breadcrumb-item>` Children\n\n`<mds-breadcrumb-item>` has no default slot; the `label` prop is the only way to set the visible text. Text or HTML placed between the tags is ignored and never rendered.\n\n```html\n<!-- INCORRECT -->\n<mds-breadcrumb>\n  <mds-breadcrumb-item>\n    <strong>Categoria</strong>\n  </mds-breadcrumb-item>\n  <mds-breadcrumb-item selected>\n    <span class=\"active\">Sottocategoria</span>\n  </mds-breadcrumb-item>\n</mds-breadcrumb>\n\n<!-- CORRECT -->\n<mds-breadcrumb>\n  <mds-breadcrumb-item label=\"Categoria\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Sottocategoria\" selected></mds-breadcrumb-item>\n</mds-breadcrumb>\n```\n\n#### Do Not Manage Selection State Manually by Toggling Classes\n\nThe parent tracks which item is selected internally; toggling CSS classes or `aria-current` on the host bypasses that logic and leaves the back button in an inconsistent state. Use the `selected` prop instead.\n\n```html\n<!-- INCORRECT -->\n<mds-breadcrumb>\n  <mds-breadcrumb-item label=\"Home\" class=\"is-active\" aria-current=\"page\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Archivio\"></mds-breadcrumb-item>\n</mds-breadcrumb>\n\n<!-- CORRECT -->\n<mds-breadcrumb>\n  <mds-breadcrumb-item label=\"Home\" selected></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Archivio\"></mds-breadcrumb-item>\n</mds-breadcrumb>\n```\n\n#### Do Not Pierce the Shadow DOM to Style the Internal Back Button\n\nThe back button rendered inside `<mds-breadcrumb>` is a private implementation detail: it exposes no part and no public custom property. To remove it, set `hide-back`.\n\n```css\n/* INCORRECT */\nmds-breadcrumb >>> .back {\n  background: red;\n}\nmds-breadcrumb::part(back) {\n  display: none;\n}\n\n/* CORRECT - no part reaches the back button: remove it with hide-back */\n```\n\n```html\n<!-- CORRECT -->\n<mds-breadcrumb hide-back>\n  <mds-breadcrumb-item label=\"Home\"></mds-breadcrumb-item>\n  <mds-breadcrumb-item label=\"Archivio\" selected></mds-breadcrumb-item>\n</mds-breadcrumb>\n```\n"
      },
      "props": [
        {
          "name": "hideBack",
          "type": "boolean | undefined",
          "complexType": {
            "original": "boolean",
            "resolved": "boolean | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "hide-back",
          "reflectToAttr": false,
          "docs": "Hides the back arrow button",
          "docsTags": [
            {
              "name": "default",
              "text": "false"
            }
          ],
          "default": "false",
          "values": [
            {
              "type": "boolean"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        }
      ],
      "methods": [],
      "events": [
        {
          "event": "mdsBreadcrumbChange",
          "detail": "MdsBreadcrumbEventDetail",
          "bubbles": true,
          "complexType": {
            "original": "MdsBreadcrumbEventDetail",
            "resolved": "MdsBreadcrumbEventDetail",
            "references": {
              "MdsBreadcrumbEventDetail": {
                "location": "import",
                "path": "./meta/event-detail",
                "id": "src/components/mds-breadcrumb/meta/event-detail.ts::MdsBreadcrumbEventDetail",
                "referenceLocation": "MdsBreadcrumbEventDetail"
              }
            }
          },
          "cancelable": true,
          "composed": true,
          "docs": "Emits when the breadcrumb is changed",
          "docsTags": []
        }
      ],
      "listeners": [
        {
          "event": "mdsBreadcrumbItemSelect",
          "capture": false,
          "passive": false
        }
      ],
      "styles": [
        {
          "name": "--mds-breadcrumb-arrow-depth-color",
          "annotation": "prop",
          "docs": "Sets the color of the arrow icon that separates buttons",
          "visibility": "internal"
        },
        {
          "name": "--mds-breadcrumb-button-background",
          "annotation": "prop",
          "docs": "Sets the background color of the button",
          "visibility": "internal"
        },
        {
          "name": "--mds-breadcrumb-button-background-disabled",
          "annotation": "prop",
          "docs": "Sets the background color of the back arrow button when it's disabled, on the first item",
          "visibility": "internal"
        },
        {
          "name": "--mds-breadcrumb-button-background-hover",
          "annotation": "prop",
          "docs": "Sets the background color of the button when the mouse is over it",
          "visibility": "internal"
        },
        {
          "name": "--mds-breadcrumb-button-background-selected",
          "annotation": "prop",
          "docs": "Sets the background color of the button of the selected item",
          "visibility": "internal"
        },
        {
          "name": "--mds-breadcrumb-button-color",
          "annotation": "prop",
          "docs": "Sets the text color of the button",
          "visibility": "internal"
        },
        {
          "name": "--mds-breadcrumb-button-color-current",
          "annotation": "prop",
          "docs": "Deprecated, use `--mds-breadcrumb-button-color-selected`; read only when that one is not set",
          "visibility": "internal"
        },
        {
          "name": "--mds-breadcrumb-button-color-hover",
          "annotation": "prop",
          "docs": "Sets the text color of the button when the mouse is over it",
          "visibility": "internal"
        },
        {
          "name": "--mds-breadcrumb-button-color-selected",
          "annotation": "prop",
          "docs": "Sets the text color of the button of the selected item",
          "visibility": "internal"
        },
        {
          "name": "--mds-breadcrumb-current-button-color",
          "annotation": "prop",
          "docs": "Deprecated, use `--mds-breadcrumb-button-color-selected`; read only when neither that one nor `--mds-breadcrumb-button-color-current` is set",
          "visibility": "internal"
        }
      ],
      "slots": [
        {
          "name": "",
          "docs": "Add `mds-breadcrumb-item` element/s."
        }
      ],
      "parts": [],
      "states": [],
      "dependents": [],
      "dependencies": [
        "mds-button"
      ],
      "dependencyGraph": {
        "mds-breadcrumb": [
          "mds-button"
        ],
        "mds-button": [
          "mds-icon",
          "mds-spinner",
          "mds-text"
        ]
      },
      "storybook": "ui-breadcrumb--docs"
    }
  ]
}
