{
  "$schema": "https://next.0build.dev/schema/component.v1.json",
  "accessibility": {
    "aria": [],
    "notes": [
      "The toaster group is a `role=\"region\"` list with a localized `aria-label` (`Notifications` by default); each toast is a `role=\"status\"` listitem with `aria-live=\"polite\"` (`assertive` for danger and warning).",
      "Close, action, and cancel controls are native `<button>` elements (or `<a href>` links when `href` is set on `action`/`cancel`) with localized labels and visible focus outlines."
    ]
  },
  "attributes": [],
  "category": "feedback",
  "children": [],
  "cssClasses": [
    {
      "appliesTo": ".z-toaster",
      "class": ".z-toast",
      "description": "Root class of a single toast (`li`); absolutely positioned in the stack with enter/leave transitions.",
      "role": "root"
    },
    {
      "appliesTo": ".z-toaster",
      "class": ".z-toast-action",
      "description": "Primary action button or link (`a[href]`) of the toast.",
      "role": "element"
    },
    {
      "appliesTo": ".z-toaster",
      "class": ".z-toast-actions",
      "description": "Row holding the action and cancel controls.",
      "role": "element"
    },
    {
      "appliesTo": ".z-toaster",
      "class": ".z-toast-blur",
      "description": "Applies a backdrop blur and a slightly translucent background to one toast.",
      "role": "modifier"
    },
    {
      "appliesTo": ".z-toaster",
      "class": ".z-toast-cancel",
      "description": "Cancel button or link (`a[href]`) of the toast.",
      "role": "element"
    },
    {
      "appliesTo": ".z-toaster",
      "class": ".z-toast-close",
      "description": "Close button in the top inline-end corner, shown when `closeButton` is enabled.",
      "role": "element"
    },
    {
      "appliesTo": ".z-toaster",
      "class": ".z-toast-content",
      "description": "Column holding the title and description.",
      "role": "element"
    },
    {
      "appliesTo": ".z-toaster",
      "class": ".z-toast-description",
      "description": "Muted secondary line under the title.",
      "role": "element"
    },
    {
      "appliesTo": ".z-toaster",
      "class": ".z-toast-icon",
      "description": "Status icon slot at the start of the toast; colored by `data-status`.",
      "role": "element"
    },
    {
      "appliesTo": ".z-toaster",
      "class": ".z-toast-title",
      "description": "Medium-weight toast title.",
      "role": "element"
    },
    {
      "appliesTo": ".z-toaster",
      "class": ".z-toaster",
      "description": "Root class of the fixed toaster group (`ol` appended to `body`); positions the stack at a screen corner or edge.",
      "role": "root"
    },
    {
      "appliesTo": ".z-toaster",
      "class": ".z-toaster-blur",
      "description": "Applies the backdrop blur to every toast in the group.",
      "role": "modifier"
    }
  ],
  "cssVars": [
    {
      "affects": [
        "transform"
      ],
      "default": "0px",
      "description": "Computed vertical rest position of the toast (peek or expanded offset).",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toast-base-y",
      "scope": ".z-toast",
      "syntax": "<length>"
    },
    {
      "affects": [
        "background-color"
      ],
      "default": "var(--z-drop)",
      "description": "Background color of a toast; re-tinted by rich colors.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toast-bg",
      "scope": ".z-toast",
      "syntax": "<color>"
    },
    {
      "affects": [
        "-webkit-backdrop-filter",
        "backdrop-filter"
      ],
      "default": "var(--z-global-blur)",
      "description": "Backdrop blur radius used by the blur classes.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toast-blur",
      "scope": ".z-toast",
      "syntax": ""
    },
    {
      "affects": [
        "border"
      ],
      "default": "var(--z-border)",
      "description": "Border base color, mixed with transparency using `--z-toast-border-o`.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toast-border-color",
      "scope": ".z-toast",
      "syntax": "<color>"
    },
    {
      "affects": [
        "border"
      ],
      "default": "var(--z-border-o)",
      "description": "Border opacity percentage used in the border color mix.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toast-border-o",
      "scope": ".z-toast",
      "syntax": "<percentage>"
    },
    {
      "affects": [
        "color"
      ],
      "default": "var(--z-drop-f)",
      "description": "Text color of a toast; re-tinted by rich colors.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toast-color",
      "scope": ".z-toast",
      "syntax": "<color>"
    },
    {
      "affects": [
        "color"
      ],
      "default": "var(--z-muted-f)",
      "description": "Text color of the description line.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toast-description-color",
      "scope": ".z-toast",
      "syntax": "<color>"
    },
    {
      "affects": [
        "transform"
      ],
      "default": "-1",
      "description": "Stacking direction: `-1` for bottom groups, `1` for top groups.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toast-dir",
      "scope": ".z-toast",
      "syntax": "<integer>"
    },
    {
      "affects": [
        "height"
      ],
      "default": "auto",
      "description": "Set by the singleton: measured height of the front toast, used to clip stacked toasts behind it.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "hook",
      "name": "--z-toast-front-height",
      "scope": ".z-toast[data-mounted='true'][data-expanded='false'][data-front='false']",
      "syntax": "<length>"
    },
    {
      "affects": [
        "transform",
        "z-index"
      ],
      "default": "0",
      "description": "Set by the singleton: depth of the toast in the stack (0 = front); drives stacking order, peek offset, and scale.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toast-index",
      "scope": ".z-toast",
      "syntax": "<integer>"
    },
    {
      "affects": [
        "height"
      ],
      "default": "auto",
      "description": "Set by the singleton: measured natural height of the toast, restored when the stack expands.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "hook",
      "name": "--z-toast-initial-height",
      "scope": ".z-toast[data-mounted='true'][data-expanded='true'][data-front='false']",
      "syntax": "<length>"
    },
    {
      "affects": [
        "transform"
      ],
      "default": "0px",
      "description": "Set by the singleton: expanded-stack offset of the toast from the group edge.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toast-offset",
      "scope": ".z-toast",
      "syntax": "<length>"
    },
    {
      "affects": [
        "padding"
      ],
      "default": "0.875rem 1rem",
      "description": "Inner padding of a toast.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toast-padding",
      "scope": ".z-toast",
      "syntax": "<length>+"
    },
    {
      "affects": [
        "border-radius"
      ],
      "default": "var(--z-global-radius)",
      "description": "Corner radius of a toast.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toast-radius",
      "scope": ".z-toast",
      "syntax": "<length>"
    },
    {
      "affects": [
        "transform"
      ],
      "default": "1",
      "description": "Computed scale of the toast; collapsed stacks shrink by 5% per depth.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toast-scale",
      "scope": ".z-toast",
      "syntax": "<number>"
    },
    {
      "affects": [
        "box-shadow"
      ],
      "default": "var(--z-global-shadow)",
      "description": "Box shadow of a toast.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toast-shadow",
      "scope": ".z-toast",
      "syntax": ""
    },
    {
      "affects": [
        "transform"
      ],
      "default": "0px",
      "description": "Set by the singleton: horizontal exit target of a swipe dismissal.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toast-swipe-out-x",
      "scope": ".z-toast",
      "syntax": "<length-percentage>"
    },
    {
      "affects": [
        "transform"
      ],
      "default": "0px",
      "description": "Set by the singleton: vertical exit target of a swipe dismissal.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toast-swipe-out-y",
      "scope": ".z-toast",
      "syntax": "<length-percentage>"
    },
    {
      "affects": [
        "transform"
      ],
      "default": "0px",
      "description": "Set by the singleton: live horizontal swipe offset.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toast-swipe-x",
      "scope": ".z-toast",
      "syntax": "<length>"
    },
    {
      "affects": [
        "transform"
      ],
      "default": "0px",
      "description": "Set by the singleton: live vertical swipe offset.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toast-swipe-y",
      "scope": ".z-toast",
      "syntax": "<length>"
    },
    {
      "affects": [
        "height"
      ],
      "default": "0.75rem",
      "description": "Gap between toasts when the stack is expanded.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toaster-gap",
      "scope": ".z-toaster",
      "syntax": "<length>"
    },
    {
      "affects": [
        "inset-inline-end",
        "inset-inline-start",
        "max-width"
      ],
      "default": "1.5rem",
      "description": "Horizontal distance from the viewport edge.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toaster-offset-x",
      "scope": ".z-toaster",
      "syntax": "<length>"
    },
    {
      "affects": [
        "bottom",
        "top"
      ],
      "default": "1.5rem",
      "description": "Vertical distance from the viewport edge.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toaster-offset-y",
      "scope": ".z-toaster",
      "syntax": "<length>"
    },
    {
      "affects": [
        "transform"
      ],
      "default": "0.875rem",
      "description": "Visible sliver of each stacked toast when the group is collapsed.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toaster-peek",
      "scope": ".z-toaster",
      "syntax": "<length>"
    },
    {
      "affects": [
        "width"
      ],
      "default": "22.25rem",
      "description": "Width of the toaster group on wide viewports.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toaster-width",
      "scope": ".z-toaster",
      "syntax": "<length>"
    },
    {
      "affects": [
        "z-index"
      ],
      "default": "1040",
      "description": "Stacking order of the toaster group.",
      "file": "src/css/kit-components/toaster.css",
      "kind": "base",
      "name": "--z-toaster-z-index",
      "scope": ".z-toaster",
      "syntax": "<integer>"
    }
  ],
  "dataHooks": [
    {
      "appliesTo": "descendant",
      "attribute": "data-close-button",
      "description": "Whether the toast renders a close button.",
      "role": "marker",
      "values": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-dismissible",
      "description": "Whether swipe dismissal is enabled for the toast.",
      "role": "marker",
      "values": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-expanded",
      "description": "Whether the group is expanded (hover/focus) or collapsed to the peek stack.",
      "role": "marker",
      "values": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-front",
      "description": "Whether this toast is the front (newest) item of the collapsed stack.",
      "role": "marker",
      "values": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-mounted",
      "description": "`false` until the first animation frame, then `true`; drives the enter transition.",
      "role": "marker",
      "values": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-position",
      "description": "On the toaster group: the screen position (`bottom-right` by default, plus `bottom-left`, `bottom-center`, `top-right`, `top-left`, `top-center`).",
      "role": "marker",
      "values": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-removed",
      "description": "Set `true` while the toast plays its leave transition.",
      "role": "marker",
      "values": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-rich-colors",
      "description": "Whether status colors tint the whole toast (from the `richColors` option).",
      "role": "marker",
      "values": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-status",
      "description": "Toast status (`default`, `success`, `danger`, `warning`, `info`, `loading`); colors the icon and, with rich colors, the whole toast.",
      "role": "marker",
      "values": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-swipe-out",
      "description": "Set `true` when a swipe dismisses the toast; plays the swipe-out transform.",
      "role": "marker",
      "values": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-swiping",
      "description": "Set `true` during an active swipe; disables transitions.",
      "role": "marker",
      "values": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-toast-id",
      "description": "The toast's id, set on its `li` element.",
      "role": "marker",
      "values": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-visible",
      "description": "Set `false` for toasts beyond the `max` visible count.",
      "role": "marker",
      "values": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-x-position",
      "description": "On each toast: `left`, `right`, or `center`; used for swipe-direction resistance.",
      "role": "marker",
      "values": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-y-position",
      "description": "On each toast: `top` or `bottom`, derived from its group; flips the stacking direction and transform origin.",
      "role": "marker",
      "values": []
    }
  ],
  "events": [],
  "i18n": [],
  "icons": [],
  "id": "toast",
  "inherits": [],
  "keyboard": [],
  "kind": "css",
  "methods": [
    {
      "description": "Reads or updates the global defaults (position, duration, max, expand, dismissible, closeButton, richColors, blur, gap, offset, cls, stl, i18n) and returns the current configuration.",
      "name": "config",
      "params": [
        {
          "default": null,
          "name": "options",
          "optional": true,
          "type": "ZToastGlobalConfig"
        }
      ],
      "returns": "Readonly<InternalGlobalConfig>",
      "static": false
    },
    {
      "description": "Shows a toast with the danger status icon and coloring; returns its id.",
      "name": "danger",
      "params": [
        {
          "default": null,
          "name": "input",
          "optional": false,
          "type": "string | ZToastOptions"
        },
        {
          "default": null,
          "name": "options",
          "optional": true,
          "type": "ZToastOptions"
        }
      ],
      "returns": "string",
      "static": false
    },
    {
      "description": "Dismisses one toast by id, or every toast when called without an id.",
      "name": "dismiss",
      "params": [
        {
          "default": null,
          "name": "id",
          "optional": true,
          "type": "string"
        }
      ],
      "returns": "void",
      "static": false
    },
    {
      "description": "Alias of `danger`.",
      "name": "error",
      "params": [
        {
          "default": null,
          "name": "input",
          "optional": false,
          "type": "string | ZToastOptions"
        },
        {
          "default": null,
          "name": "options",
          "optional": true,
          "type": "ZToastOptions"
        }
      ],
      "returns": "string",
      "static": false
    },
    {
      "description": "Shows a toast with the info status icon and coloring; returns its id.",
      "name": "info",
      "params": [
        {
          "default": null,
          "name": "input",
          "optional": false,
          "type": "string | ZToastOptions"
        },
        {
          "default": null,
          "name": "options",
          "optional": true,
          "type": "ZToastOptions"
        }
      ],
      "returns": "string",
      "static": false
    },
    {
      "description": "Shows a persistent loading toast with no auto-dismiss timeout; returns its id.",
      "name": "loading",
      "params": [
        {
          "default": null,
          "name": "input",
          "optional": false,
          "type": "string | ZToastOptions"
        },
        {
          "default": null,
          "name": "options",
          "optional": true,
          "type": "ZToastOptions"
        }
      ],
      "returns": "string",
      "static": false
    },
    {
      "description": "Shows a neutral toast and returns its id. Accepts a message string or a full options object.",
      "name": "message",
      "params": [
        {
          "default": null,
          "name": "input",
          "optional": false,
          "type": "string | ZToastOptions"
        },
        {
          "default": null,
          "name": "options",
          "optional": true,
          "type": "ZToastOptions"
        }
      ],
      "returns": "string",
      "static": false
    },
    {
      "description": "Shows a loading toast that updates to success or danger when the promise settles. Branches accept strings, options objects, or functions of the settled value; a missing branch dismisses the toast. Returns the id plus a thenable with `unwrap()`.",
      "name": "promise",
      "params": [
        {
          "default": null,
          "name": "promise",
          "optional": false,
          "type": "Promise<T> | (() => Promise<T>)"
        },
        {
          "default": null,
          "name": "options",
          "optional": false,
          "type": "ZToastPromiseOptions<T>"
        }
      ],
      "returns": "ZToastPromiseResult<T>",
      "static": false
    },
    {
      "description": "Shows a toast with the success status icon and coloring; returns its id.",
      "name": "success",
      "params": [
        {
          "default": null,
          "name": "input",
          "optional": false,
          "type": "string | ZToastOptions"
        },
        {
          "default": null,
          "name": "options",
          "optional": true,
          "type": "ZToastOptions"
        }
      ],
      "returns": "string",
      "static": false
    },
    {
      "description": "Updates an existing toast in place (same id), merging options and restarting its timer.",
      "name": "update",
      "params": [
        {
          "default": null,
          "name": "id",
          "optional": false,
          "type": "string"
        },
        {
          "default": null,
          "name": "input",
          "optional": false,
          "type": "string | ZToastOptions"
        },
        {
          "default": null,
          "name": "options",
          "optional": true,
          "type": "ZToastOptions"
        }
      ],
      "returns": "string",
      "static": false
    },
    {
      "description": "Shows a toast with the warning status icon and coloring; returns its id.",
      "name": "warning",
      "params": [
        {
          "default": null,
          "name": "input",
          "optional": false,
          "type": "string | ZToastOptions"
        },
        {
          "default": null,
          "name": "options",
          "optional": true,
          "type": "ZToastOptions"
        }
      ],
      "returns": "string",
      "static": false
    }
  ],
  "notes": [
    "Toasts are created imperatively (`zToast.success('Saved')`); the toaster group is created on demand and appended to `body`, so no markup is required. The toast pack exposes `window.zToast`.",
    "Setting `href` on `action` or `cancel` renders a native `<a>` link (supporting `target` and `rel`, defaulting `rel` to `noopener noreferrer` for `target=\"_blank\"`) while still running `onClick` and dismissing unless prevented.",
    "Collapsed stacks peek by `--z-toaster-peek` per item and scale down by 5% per depth; hovering or focusing the group expands it.",
    "Auto-dismiss timers pause while the group is expanded or hovered, or the page is hidden; `loading` toasts never auto-dismiss. Default duration is 4000 ms (danger 6000 ms).",
    "Toasts can be swiped away along the group's edge direction; `dismissible: false` or interactive content under the pointer blocks the swipe.",
    "On viewports up to 40rem wide the group spans the viewport with 1rem side offsets."
  ],
  "parts": {
    "defaultClsTarget": null,
    "defaultStlTarget": null,
    "items": []
  },
  "recipes": [],
  "related": [
    "alert"
  ],
  "schemaVersion": 1,
  "sources": {
    "css": [
      "src/css/kit-components/toaster.css"
    ],
    "cssSelectors": [
      ".z-toaster",
      ".z-toaster-*",
      ".z-toast",
      ".z-toast-*"
    ],
    "singleton": {
      "api": "ZToast",
      "file": "src/js/singletons/toast.ts",
      "scope": ".z-toast"
    },
    "ts": null
  },
  "summary": "Sonner-style stacked notifications created imperatively through `window.zToast`, grouped by screen position, with swipe dismissal and promise helpers.",
  "tag": null,
  "title": "Toast"
}
