{
  "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-table-footer/mds-table-footer.tsx",
      "encapsulation": "shadow",
      "tag": "mds-table-footer",
      "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-table-cell` element/s: the footer is itself a row, for totals and counts."
        },
        {
          "name": "parent",
          "text": "mds-table"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-table-footer>` web component is a structural child of [`<mds-table>`](../mds-table/AGENTS.md) that renders the footer row of a table - typically used for totals or summaries. Unlike the native `<tfoot>`, it is itself a row (`role=\"row\"`, `display: table-row`): its single slot takes `mds-table-cell` children directly, one per column.\n\n#### Semantic Behavior\n\n- **Compound child only**: Must be placed as a direct slot child of `<mds-table>`, alongside `mds-table-header` and `mds-table-body`; it is not used standalone or nested inside another child type.\n- **Structural passthrough**: It renders nothing but a single default slot - a purely structural wrapper with no rendered chrome of its own.\n- **Lines up with the rows**: The footer is no selectable data row, but it keeps the columns of one: in a `selectable` table the parent sets the footer's `selectable` and the footer adds an empty first cell, where the rows have their checkbox; when the rows have `slot=\"action\"` content on load, it adds an empty last cell, where the rows have their actions.\n\n#### Properties & Visual Configurations\n\n`<mds-table-footer>` has one prop, `selectable`, which `<mds-table>` sets: leave it to the parent. Its main API is its **default slot**, into which you place one `mds-table-cell` per column of your data, not counting the selection and actions columns. Visual styling (background, borders, cell padding) is inherited from the CSS custom properties defined on the parent `<mds-table>`.\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-table-footer>` 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#### Summary Row with Column Labels\n\nThe most common pattern: a footer row that repeats the column headings as a visual anchor at the bottom of a long table. Place `mds-table-footer` as a direct child of [`mds-table`](../mds-table/AGENTS.md), after `mds-table-body`, containing one `mds-table-cell` per column.\n\n```html\n<mds-table>\n  <mds-table-header>\n    <mds-table-header-cell label=\"Cognome e nome\"></mds-table-header-cell>\n    <mds-table-header-cell label=\"Email\"></mds-table-header-cell>\n    <mds-table-header-cell label=\"Data\"></mds-table-header-cell>\n  </mds-table-header>\n  <mds-table-body>\n    <mds-table-row>\n      <mds-table-cell><mds-text typography=\"detail\">Rossi Mario</mds-text></mds-table-cell>\n      <mds-table-cell><mds-text typography=\"detail\">m.rossi@example.it</mds-text></mds-table-cell>\n      <mds-table-cell><mds-text typography=\"detail\">12 ott 1985</mds-text></mds-table-cell>\n    </mds-table-row>\n    <mds-table-row>\n      <mds-table-cell><mds-text typography=\"detail\">Verdi Luigi</mds-text></mds-table-cell>\n      <mds-table-cell><mds-text typography=\"detail\">l.verdi@example.it</mds-text></mds-table-cell>\n      <mds-table-cell><mds-text typography=\"detail\">3 mar 1993</mds-text></mds-table-cell>\n    </mds-table-row>\n  </mds-table-body>\n  <mds-table-footer>\n    <mds-table-cell><mds-text typography=\"action\">Cognome e nome</mds-text></mds-table-cell>\n    <mds-table-cell><mds-text typography=\"action\">Email</mds-text></mds-table-cell>\n    <mds-table-cell><mds-text typography=\"action\">Data</mds-text></mds-table-cell>\n  </mds-table-footer>\n</mds-table>\n```\n\n#### Totals Row\n\nUse the footer to display computed totals or aggregated values that summarize the body rows. Cell content can be any component accepted by `mds-table-cell`.\n\n```html\n<mds-table>\n  <mds-table-header>\n    <mds-table-header-cell label=\"Voce di spesa\"></mds-table-header-cell>\n    <mds-table-header-cell label=\"Importo\"></mds-table-header-cell>\n    <mds-table-header-cell label=\"Stato\"></mds-table-header-cell>\n  </mds-table-header>\n  <mds-table-body>\n    <mds-table-row>\n      <mds-table-cell><mds-text typography=\"detail\">Licenze software</mds-text></mds-table-cell>\n      <mds-table-cell><mds-text typography=\"detail\">1.200,00 EUR</mds-text></mds-table-cell>\n      <mds-table-cell><mds-badge variant=\"success\" tone=\"weak\" label=\"Approvato\"></mds-badge></mds-table-cell>\n    </mds-table-row>\n    <mds-table-row>\n      <mds-table-cell><mds-text typography=\"detail\">Consulenza</mds-text></mds-table-cell>\n      <mds-table-cell><mds-text typography=\"detail\">3.500,00 EUR</mds-text></mds-table-cell>\n      <mds-table-cell><mds-badge variant=\"warning\" tone=\"weak\" label=\"In attesa\"></mds-badge></mds-table-cell>\n    </mds-table-row>\n  </mds-table-body>\n  <mds-table-footer>\n    <mds-table-cell><mds-text typography=\"action\">Totale</mds-text></mds-table-cell>\n    <mds-table-cell><mds-text typography=\"action\">4.700,00 EUR</mds-text></mds-table-cell>\n    <mds-table-cell></mds-table-cell>\n  </mds-table-footer>\n</mds-table>\n```\n\n#### Multiple Footer Rows\n\n`mds-table-footer` is a single row, so it never wraps `mds-table-row` (a row nested in a row breaks the column layout). When you need more than one footer row - for example a subtotal row followed by a grand total row - place one `mds-table-footer` per row, one after the other.\n\n```html\n<mds-table>\n  <mds-table-header>\n    <mds-table-header-cell label=\"Descrizione\"></mds-table-header-cell>\n    <mds-table-header-cell label=\"Imponibile\"></mds-table-header-cell>\n    <mds-table-header-cell label=\"IVA 22%\"></mds-table-header-cell>\n  </mds-table-header>\n  <mds-table-body>\n    <mds-table-row>\n      <mds-table-cell><mds-text typography=\"detail\">Servizio A</mds-text></mds-table-cell>\n      <mds-table-cell><mds-text typography=\"detail\">800,00 EUR</mds-text></mds-table-cell>\n      <mds-table-cell><mds-text typography=\"detail\">176,00 EUR</mds-text></mds-table-cell>\n    </mds-table-row>\n  </mds-table-body>\n  <mds-table-footer>\n    <mds-table-cell><mds-text typography=\"detail\">Subtotale</mds-text></mds-table-cell>\n    <mds-table-cell><mds-text typography=\"detail\">800,00 EUR</mds-text></mds-table-cell>\n    <mds-table-cell><mds-text typography=\"detail\">176,00 EUR</mds-text></mds-table-cell>\n  </mds-table-footer>\n  <mds-table-footer>\n    <mds-table-cell><mds-text typography=\"action\">Totale</mds-text></mds-table-cell>\n    <mds-table-cell><mds-text typography=\"action\">976,00 EUR</mds-text></mds-table-cell>\n    <mds-table-cell></mds-table-cell>\n  </mds-table-footer>\n</mds-table>\n```\n\n#### Cell-Level Styling via Parent `--mds-table-*` Custom Properties\n\n`mds-table-footer` has no public CSS custom property: it inherits visual styling from the public CSS custom properties defined on the parent `mds-table`. Set those properties on `mds-table` (or a wrapping selector) to restyle the background, the text colour and the cell padding uniformly across the whole table - including the footer. The line above the footer is part of the grid, so it takes the same colour as the other lines of the table. `--mds-table-cell-padding` takes a single length: the table also halves it and adds it to other measures.\n\n```css\n.bilancio-table mds-table {\n  --mds-table-background: rgb(var(--magma-surface-raised));\n  --mds-table-cell-padding: calc(var(--spacing) * 300);\n  --mds-table-color: rgb(var(--magma-text-default));\n}\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-table-footer>`. 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 `mds-table-footer` Outside `mds-table`\n\n`mds-table-footer` is a compound child and must be a direct slot child of [`mds-table`](../mds-table/AGENTS.md). Using it outside its parent breaks the internal layout communication and produces unstyled, structurally invalid output.\n\n```html\n<!-- INCORRECT -->\n<div class=\"table-wrapper\">\n  <mds-table-footer>\n    <mds-table-cell>Totale</mds-table-cell>\n  </mds-table-footer>\n</div>\n\n<!-- CORRECT -->\n<mds-table>\n  <mds-table-body><!-- ... --></mds-table-body>\n  <mds-table-footer>\n    <mds-table-cell><mds-text typography=\"action\">Totale</mds-text></mds-table-cell>\n  </mds-table-footer>\n</mds-table>\n```\n\n#### Do Not Put Raw Text or `<td>` Elements in the Footer Slot\n\nThe default slot of `mds-table-footer` accepts `mds-table-cell` elements. Raw text, `<td>`, or arbitrary HTML bypasses the shared border and padding tokens and yields a visually broken footer.\n\n```html\n<!-- INCORRECT -->\n<mds-table-footer>\n  <td>Cognome e nome</td>\n  <td>Email</td>\n</mds-table-footer>\n\n<!-- CORRECT -->\n<mds-table-footer>\n  <mds-table-cell><mds-text typography=\"action\">Cognome e nome</mds-text></mds-table-cell>\n  <mds-table-cell><mds-text typography=\"action\">Email</mds-text></mds-table-cell>\n</mds-table-footer>\n```\n\n#### Do Not Replace `mds-table-footer` with a `<tfoot>` Element\n\nUsing the native `<tfoot>` inside `mds-table` bypasses the shared CSS token cascade, border transition, and reduced-motion handling that `mds-table-footer` wires up. Always use the Magma component.\n\n```html\n<!-- INCORRECT -->\n<mds-table>\n  <mds-table-body><!-- ... --></mds-table-body>\n  <tfoot>\n    <tr><td>Totale</td><td>4.700,00 EUR</td></tr>\n  </tfoot>\n</mds-table>\n\n<!-- CORRECT -->\n<mds-table>\n  <mds-table-body><!-- ... --></mds-table-body>\n  <mds-table-footer>\n    <mds-table-cell><mds-text typography=\"action\">Totale</mds-text></mds-table-cell>\n    <mds-table-cell><mds-text typography=\"action\">4.700,00 EUR</mds-text></mds-table-cell>\n  </mds-table-footer>\n</mds-table>\n```\n\n#### Do Not Style the Footer by Piercing Shadow DOM\n\n`mds-table-footer` has no public CSS custom property. Styling changes (background, text colour, cell spacing) must go through the public `--mds-table-*` custom properties on the parent `mds-table`. Targeting internals via `>>>` or undocumented selectors will break on future releases.\n\n```css\n/* INCORRECT */\nmds-table-footer >>> :host {\n  background: rgb(var(--magma-surface-raised));\n}\n\n/* CORRECT */\nmds-table {\n  --mds-table-background: rgb(var(--magma-surface-raised));\n  --mds-table-cell-padding: calc(var(--spacing) * 300);\n}\n```\n\n#### Do Not Use `mds-table-footer` as the Only Section of a Table\n\n`mds-table-footer` provides summary or totals context and is meaningful only when accompanied by `mds-table-body` (and usually `mds-table-header`). A footer-only table has no data for the summary to refer to.\n\n```html\n<!-- INCORRECT -->\n<mds-table>\n  <mds-table-footer>\n    <mds-table-cell>Nessun dato disponibile</mds-table-cell>\n  </mds-table-footer>\n</mds-table>\n\n<!-- CORRECT: use mds-zero for empty states, or include mds-table-body -->\n<mds-table>\n  <mds-table-header>\n    <mds-table-header-cell label=\"Voce\"></mds-table-header-cell>\n  </mds-table-header>\n  <mds-table-body>\n    <mds-table-row>\n      <mds-table-cell><mds-text typography=\"detail\">Nessun record</mds-text></mds-table-cell>\n    </mds-table-row>\n  </mds-table-body>\n</mds-table>\n```\n"
      },
      "props": [
        {
          "name": "selectable",
          "type": "boolean | undefined",
          "complexType": {
            "original": "boolean",
            "resolved": "boolean | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "selectable",
          "reflectToAttr": false,
          "docs": "Adds an empty cell in the selection column, so that the cells of the footer line up with the\nones of the rows: `mds-table` sets it from its own `selectable`",
          "docsTags": [],
          "values": [
            {
              "type": "boolean"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        }
      ],
      "methods": [],
      "events": [],
      "listeners": [],
      "styles": [],
      "slots": [
        {
          "name": "",
          "docs": "Add `mds-table-cell` element/s: the footer is itself a row, for totals and counts."
        }
      ],
      "parts": [],
      "states": [],
      "dependents": [],
      "dependencies": [
        "mds-table-cell"
      ],
      "dependencyGraph": {
        "mds-table-footer": [
          "mds-table-cell"
        ]
      },
      "storybook": "layout-table-footer--docs"
    }
  ]
}
