{
  "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-horizontal-scroll/mds-horizontal-scroll.tsx",
      "encapsulation": "shadow",
      "tag": "mds-horizontal-scroll",
      "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 `text string`, `HTML elements` or `components` to this slot."
        },
        {
          "name": "part",
          "text": "content - The track that scrolls, with the default slot inside"
        },
        {
          "name": "category",
          "text": "structure"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-horizontal-scroll>` web component is a horizontally scrolling container of the Magma Design System. It wraps any slotted content in a snap-scrolling viewport and overlays optional navigation controls, replacing the manual overflow/scroll-snap CSS plumbing you would otherwise write around a `<div>`.\n\n#### Semantic Behavior\n\n- **Slotted children drive scrolling**: The default slot's children are the scrollable items.\n- **Navigation buttons**: When `controls` resolves to a viewport other than `'none'`, two arrow buttons are rendered, icon-only and named in the page language (the `lang` of `<html>`) (\"Scroll back\", \"Scroll forward\"); each advances the scroll position to the next/previous item not fully in the viewport. Browsers without the `scrollend` event get no arrows: the component clears `controls` there.\n- **Auto-disabled arrows**: The back arrow hides/disables when the first item is fully visible and the forward arrow when the last item is.\n- **Position indicator**: With `navigation=\"position\"` a proportional dot is rendered; its width reflects the visible/total ratio and it translates along its track as the container scrolls.\n- **No focus or form semantics**: This is a presentational scroll container - it is not form-associated, exposes no implicit ARIA role, and emits no custom events.\n\n#### Properties & Visual Configurations\n\n- **`controls`** selects the smallest viewport breakpoint at which the arrow navigation appears (default `'desktop'`); pick a wider tier like `'large'` or `'wide'` to show arrows only on big screens, or `'none'` to suppress them entirely. The chosen value is the threshold, not a single device.\n- **`navigation`** chooses the scroll-progress affordance: `'position'` renders the translating dot indicator, `'scrollbar'` defers to the styled native browser scrollbar, and `'none'` shows neither.\n- **`snap`** sets the scroll-snap alignment of each item against the viewport - `'start'` (default) aligns items to the leading edge, `'center'` keeps them centred, `'end'` to the trailing edge, and `'none'` disables snapping for free scrolling.\n\nThis component does not use the shared `variant` / `tone` ladders defined in [`agents/variants.md`](../../../../agents/variants.md); its public CSS custom properties set the layout (the width of the items area and the margin of the controls) and its colours follow the theme (see [`AGENTS.md`](AGENTS.md)).\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-horizontal-scroll>` 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 Horizontal Scroll with Cards\n\nThe canonical form. Slot any fixed-width children directly into the component; it wraps them in a snap-scrolling viewport with a proportional dot indicator and arrow buttons automatically.\n\n```html\n<mds-horizontal-scroll>\n  <mds-card class=\"min-w-[320px]\">\n    <mds-card-header>Servizio 1</mds-card-header>\n    <mds-card-content>Descrizione del primo servizio.</mds-card-content>\n  </mds-card>\n  <mds-card class=\"min-w-[320px]\">\n    <mds-card-header>Servizio 2</mds-card-header>\n    <mds-card-content>Descrizione del secondo servizio.</mds-card-content>\n  </mds-card>\n  <mds-card class=\"min-w-[320px]\">\n    <mds-card-header>Servizio 3</mds-card-header>\n    <mds-card-content>Descrizione del terzo servizio.</mds-card-content>\n  </mds-card>\n</mds-horizontal-scroll>\n```\n\n#### Controlling Navigation Arrow Visibility\n\nUse `controls` to restrict arrow buttons to specific viewport tiers. The value is the minimum breakpoint at which arrows appear - `'desktop'` (default) shows them only on desktop and above; `'all'` shows them at every viewport size; `'none'` suppresses them entirely.\n\n```html\n<!-- Arrows only on desktop and above (default) -->\n<mds-horizontal-scroll controls=\"desktop\">\n  <!-- slotted items -->\n</mds-horizontal-scroll>\n\n<!-- Arrows on all viewports, including mobile -->\n<mds-horizontal-scroll controls=\"all\">\n  <!-- slotted items -->\n</mds-horizontal-scroll>\n\n<!-- No arrows - touch / keyboard scroll only -->\n<mds-horizontal-scroll controls=\"none\">\n  <!-- slotted items -->\n</mds-horizontal-scroll>\n```\n\n#### Scroll Progress Indicator\n\nUse `navigation` to choose the scroll-position affordance shown below the items. `'position'` (default) renders a proportional translating dot; `'scrollbar'` defers to the styled native browser scrollbar; `'none'` hides both.\n\n```html\n<!-- Dot indicator (default) -->\n<mds-horizontal-scroll navigation=\"position\">\n  <!-- slotted items -->\n</mds-horizontal-scroll>\n\n<!-- Native scrollbar instead of dot -->\n<mds-horizontal-scroll navigation=\"scrollbar\">\n  <!-- slotted items -->\n</mds-horizontal-scroll>\n\n<!-- No progress indicator -->\n<mds-horizontal-scroll navigation=\"none\">\n  <!-- slotted items -->\n</mds-horizontal-scroll>\n```\n\n#### Snap Alignment\n\n`snap` controls how each item aligns to the viewport edge when the scroll settles. Use `'start'` (default) for left-aligned cards, `'center'` for centred carousels, `'end'` for right-aligned layouts, or `'none'` to allow free scrolling without snapping.\n\n```html\n<!-- Leading-edge alignment (default, most common) -->\n<mds-horizontal-scroll snap=\"start\">\n  <!-- slotted items -->\n</mds-horizontal-scroll>\n\n<!-- Centred alignment - good for full-bleed hero carousels -->\n<mds-horizontal-scroll snap=\"center\">\n  <!-- slotted items -->\n</mds-horizontal-scroll>\n\n<!-- Free scroll - no snapping -->\n<mds-horizontal-scroll snap=\"none\">\n  <!-- slotted items -->\n</mds-horizontal-scroll>\n```\n\n#### Combining Props for a Mobile-Friendly Carousel\n\nPair `controls=\"all\"` with `snap=\"center\"` and `navigation=\"position\"` to produce a touch-and-arrow carousel that works at every breakpoint.\n\n```html\n<mds-horizontal-scroll controls=\"all\" snap=\"center\" navigation=\"position\">\n  <mds-card class=\"min-w-[280px]\">\n    <mds-card-media>\n      <mds-img src=\"https://example.com/img1.jpg\" alt=\"\"></mds-img>\n    </mds-card-media>\n    <mds-card-content>\n      <mds-text typography=\"h5\">Categoria A</mds-text>\n    </mds-card-content>\n  </mds-card>\n  <mds-card class=\"min-w-[280px]\">\n    <mds-card-media>\n      <mds-img src=\"https://example.com/img2.jpg\" alt=\"\"></mds-img>\n    </mds-card-media>\n    <mds-card-content>\n      <mds-text typography=\"h5\">Categoria B</mds-text>\n    </mds-card-content>\n  </mds-card>\n</mds-horizontal-scroll>\n```\n\n#### Styling Customization\n\nStyle the component only through its public `--mds-horizontal-scroll-*` CSS custom properties, which set its layout: the width of the items area and how far the controls sit outside it. Set them on the host or a parent selector. The dot indicator and the controls take their colours from the semantic roles, so they follow dark mode without overrides.\n\n```css\n.sezione-evidenza mds-horizontal-scroll {\n  --mds-horizontal-scroll-max-width: 1200px;\n}\n```\n\n#### Styling the Scrollbar\n\nWhen `navigation=\"scrollbar\"` is used, the component styles the native scrollbar itself, from the semantic color roles, so it follows dark mode; its size and colours have no public custom property. When the scrollbar does not suit the layout, pick another affordance with `navigation` instead of restyling it.\n\n#### Customizing the Content Part\n\nThe inner scroll container is exposed as `::part(content)`. Use it sparingly - only when a CSS custom property cannot satisfy your requirement - to apply layout overrides without piercing undocumented internals.\n\n```css\nmds-horizontal-scroll::part(content) {\n  padding-block: calc(var(--spacing) * 800);\n}\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-horizontal-scroll>`. 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 Set `controls` to a Boolean\n\n`controls` is a `ViewportType` string prop, not a boolean. Setting it without a value (or as `\"\"`) gives an empty string, which renders no arrows at all - the opposite of what a bare boolean attribute suggests. Always supply an explicit string value.\n\n```html\n<!-- INCORRECT -->\n<mds-horizontal-scroll controls>\n  <!-- slotted items -->\n</mds-horizontal-scroll>\n\n<!-- CORRECT -->\n<mds-horizontal-scroll controls=\"desktop\">\n  <!-- slotted items -->\n</mds-horizontal-scroll>\n```\n\n#### Do Not Wrap Slotted Items in an Extra Div\n\nAdding a single wrapper `<div>` around all children collapses the scroll track to one item. The component's arrow and snap logic iterates over the direct slot children - each scrollable item must be a direct child, not grandchildren inside a wrapper.\n\n```html\n<!-- INCORRECT -->\n<mds-horizontal-scroll>\n  <div>\n    <mds-card class=\"min-w-[320px]\">...</mds-card>\n    <mds-card class=\"min-w-[320px]\">...</mds-card>\n  </div>\n</mds-horizontal-scroll>\n\n<!-- CORRECT -->\n<mds-horizontal-scroll>\n  <mds-card class=\"min-w-[320px]\">...</mds-card>\n  <mds-card class=\"min-w-[320px]\">...</mds-card>\n</mds-horizontal-scroll>\n```\n\n#### Do Not Set `controls=\"none\"` as Boolean False\n\n`controls` has no boolean semantic. Removing arrow buttons is done with `controls=\"none\"`, not by writing `controls=\"false\"` or `disabled`. The string `\"false\"` is not a `ViewportType`: the arrows end up hidden only because no breakpoint rule matches it, and a type check rejects it.\n\n```html\n<!-- INCORRECT -->\n<mds-horizontal-scroll controls=\"false\">\n  <!-- slotted items -->\n</mds-horizontal-scroll>\n\n<!-- CORRECT -->\n<mds-horizontal-scroll controls=\"none\">\n  <!-- slotted items -->\n</mds-horizontal-scroll>\n```\n\n#### Do Not Use a Raw `<div>` Scroll Container Instead\n\nReplacing `<mds-horizontal-scroll>` with a manually styled `<div style=\"overflow-x: auto\">` loses the managed arrow buttons, the dot indicator, scroll-snap wiring, and the `controls` breakpoint logic. Use the component.\n\n```html\n<!-- INCORRECT -->\n<div style=\"overflow-x: auto; display: flex; gap: 16px;\">\n  <mds-card class=\"min-w-[320px]\">...</mds-card>\n  <mds-card class=\"min-w-[320px]\">...</mds-card>\n</div>\n\n<!-- CORRECT -->\n<mds-horizontal-scroll>\n  <mds-card class=\"min-w-[320px]\">...</mds-card>\n  <mds-card class=\"min-w-[320px]\">...</mds-card>\n</mds-horizontal-scroll>\n```\n\n#### Do Not Pierce the Shadow DOM to Style Internal Elements\n\nThe navigation buttons and dot indicator live inside the shadow DOM. Targeting them via `>>>`, `/deep/`, or undocumented class names (`.navigation`, `.dot`) will break on future releases. Use the public `--mds-horizontal-scroll-*` CSS custom properties and the `content` part instead; the dot and the controls take their colours from the theme.\n\n```css\n/* INCORRECT */\nmds-horizontal-scroll >>> .dot {\n  background: red;\n}\nmds-horizontal-scroll >>> .navigation {\n  border-radius: 0;\n}\n\n/* CORRECT */\nmds-horizontal-scroll {\n  --mds-horizontal-scroll-controls-margin: 0px;\n}\nmds-horizontal-scroll::part(content) {\n  padding-block: calc(var(--spacing) * 800);\n}\n```\n\n#### Do Not Provide Slotted Items Without a Fixed Width\n\nSlotted items without a declared width collapse to zero or stretch unpredictably. Always give direct children an explicit `min-width` or `width` so the container has measurable items to snap and scroll among.\n\n```html\n<!-- INCORRECT: card has no fixed width, items will collapse -->\n<mds-horizontal-scroll>\n  <mds-card>...</mds-card>\n  <mds-card>...</mds-card>\n</mds-horizontal-scroll>\n\n<!-- CORRECT: each card has a declared minimum width -->\n<mds-horizontal-scroll>\n  <mds-card class=\"min-w-[320px]\">...</mds-card>\n  <mds-card class=\"min-w-[320px]\">...</mds-card>\n</mds-horizontal-scroll>\n```\n"
      },
      "props": [
        {
          "name": "controls",
          "type": "\"all\" | \"desktop\" | \"large\" | \"none\" | \"tablet\" | \"tv\" | \"wide\" | \"xlarge\" | undefined",
          "complexType": {
            "original": "ViewportType",
            "resolved": "\"all\" | \"desktop\" | \"large\" | \"none\" | \"tablet\" | \"tv\" | \"wide\" | \"xlarge\" | undefined",
            "references": {
              "ViewportType": {
                "location": "import",
                "path": "./meta/types",
                "id": "src/components/mds-horizontal-scroll/meta/types.ts::ViewportType",
                "referenceLocation": "ViewportType"
              }
            }
          },
          "mutable": true,
          "attr": "controls",
          "reflectToAttr": true,
          "docs": "Specifies the viewport which will display navigation controls",
          "docsTags": [
            {
              "name": "default",
              "text": "'desktop'"
            }
          ],
          "default": "'desktop'",
          "values": [
            {
              "value": "all",
              "type": "string"
            },
            {
              "value": "desktop",
              "type": "string"
            },
            {
              "value": "large",
              "type": "string"
            },
            {
              "value": "none",
              "type": "string"
            },
            {
              "value": "tablet",
              "type": "string"
            },
            {
              "value": "tv",
              "type": "string"
            },
            {
              "value": "wide",
              "type": "string"
            },
            {
              "value": "xlarge",
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "navigation",
          "type": "\"none\" | \"position\" | \"scrollbar\" | undefined",
          "complexType": {
            "original": "NavigationType",
            "resolved": "\"none\" | \"position\" | \"scrollbar\" | undefined",
            "references": {
              "NavigationType": {
                "location": "import",
                "path": "./meta/types",
                "id": "src/components/mds-horizontal-scroll/meta/types.ts::NavigationType",
                "referenceLocation": "NavigationType"
              }
            }
          },
          "mutable": false,
          "attr": "navigation",
          "reflectToAttr": true,
          "docs": "Specifies the box’s snap position as an alignment of its snap area",
          "docsTags": [
            {
              "name": "default",
              "text": "'position'"
            }
          ],
          "default": "'position'",
          "values": [
            {
              "value": "none",
              "type": "string"
            },
            {
              "value": "position",
              "type": "string"
            },
            {
              "value": "scrollbar",
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "snap",
          "type": "\"center\" | \"end\" | \"none\" | \"start\" | undefined",
          "complexType": {
            "original": "SnapType",
            "resolved": "\"center\" | \"end\" | \"none\" | \"start\" | undefined",
            "references": {
              "SnapType": {
                "location": "import",
                "path": "./meta/types",
                "id": "src/components/mds-horizontal-scroll/meta/types.ts::SnapType",
                "referenceLocation": "SnapType"
              }
            }
          },
          "mutable": false,
          "attr": "snap",
          "reflectToAttr": true,
          "docs": "Specifies the box’s snap position as an alignment of its snap area",
          "docsTags": [
            {
              "name": "default",
              "text": "'start'"
            }
          ],
          "default": "'start'",
          "values": [
            {
              "value": "center",
              "type": "string"
            },
            {
              "value": "end",
              "type": "string"
            },
            {
              "value": "none",
              "type": "string"
            },
            {
              "value": "start",
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        }
      ],
      "methods": [],
      "events": [],
      "listeners": [],
      "styles": [
        {
          "name": "--mds-horizontal-scroll-behavior",
          "annotation": "prop",
          "docs": "Sets the scroll-behavior animation",
          "visibility": "internal"
        },
        {
          "name": "--mds-horizontal-scroll-controls-margin",
          "annotation": "prop",
          "docs": "Sets how far the back and forward controls sit outside the area of the slotted elements, 48px by default; `0px` keeps them on its edges",
          "visibility": "public"
        },
        {
          "name": "--mds-horizontal-scroll-dot-area-background",
          "annotation": "prop",
          "docs": "Sets the dot container area color",
          "visibility": "internal"
        },
        {
          "name": "--mds-horizontal-scroll-dot-background",
          "annotation": "prop",
          "docs": "Sets the navigation dot color",
          "visibility": "internal"
        },
        {
          "name": "--mds-horizontal-scroll-dot-max-width",
          "annotation": "prop",
          "docs": "Sets the navigation dot max-width, if you want to avoid is scales in proportion of the container",
          "visibility": "internal"
        },
        {
          "name": "--mds-horizontal-scroll-max-width",
          "annotation": "prop",
          "docs": "Sets the max-width of the slotted elements container, to keep layout limited as the rest of the sections",
          "visibility": "public"
        },
        {
          "name": "--mds-horizontal-scroll-scrollbar-margin",
          "annotation": "prop",
          "docs": "Sets the margin of the browser scroll bar (if supported)",
          "visibility": "internal"
        },
        {
          "name": "--mds-horizontal-scroll-scrollbar-radius",
          "annotation": "prop",
          "docs": "Sets the border-radius of the browser scroll bar (if supported)",
          "visibility": "internal"
        },
        {
          "name": "--mds-horizontal-scroll-scrollbar-size",
          "annotation": "prop",
          "docs": "Sets the height and width of the browser scroll bar (if supported)",
          "visibility": "internal"
        },
        {
          "name": "--mds-horizontal-scroll-scrollbar-thumb-background",
          "annotation": "prop",
          "docs": "Sets the background-color of the browser scroll bar thumb (if supported)",
          "visibility": "internal"
        },
        {
          "name": "--mds-horizontal-scroll-scrollbar-track-background",
          "annotation": "prop",
          "docs": "Sets the background-color of the browser scroll bar track (if supported)",
          "visibility": "internal"
        }
      ],
      "slots": [
        {
          "name": "",
          "docs": "Add `text string`, `HTML elements` or `components` to this slot."
        }
      ],
      "parts": [
        {
          "name": "content",
          "docs": "The track that scrolls, with the default slot inside"
        }
      ],
      "states": [],
      "dependents": [],
      "dependencies": [
        "mds-button"
      ],
      "dependencyGraph": {
        "mds-horizontal-scroll": [
          "mds-button"
        ],
        "mds-button": [
          "mds-icon",
          "mds-spinner",
          "mds-text"
        ]
      },
      "storybook": "layout-horizontal-scroll--docs"
    }
  ]
}
