{
  "$schema": "https://next.0build.dev/schema/component.v1.json",
  "accessibility": {
    "aria": [],
    "notes": [
      "The layout placeholder is marked `aria-hidden=\"true\"` and `hidden` when not in use, so assistive technology ignores it."
    ]
  },
  "attributes": [
    {
      "default": "'top'",
      "description": "Edge the element sticks to: `top` once scrolled past its natural position, or `bottom` of the viewport.",
      "from": null,
      "name": "position",
      "property": "position",
      "reflect": false,
      "tokens": null,
      "type": "'top' | 'bottom'",
      "values": [
        "top",
        "bottom"
      ]
    },
    {
      "default": "'0'",
      "description": "Distance from the sticking edge. Accepts a length (`px`, `rem`, `em`, viewport units, or `%` of the viewport height), a CSS selector whose visible height is used, `selector + length` / `selector - length`, or `!selector` for the nearest matching ancestor.",
      "from": null,
      "name": "offset",
      "property": "offset",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "'0'",
      "description": "Distance from the opposite edge, used when computing overflow and the bottom sticking position; accepts the same syntax as `offset`.",
      "from": null,
      "name": "offset-end",
      "property": "offset-end",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "''",
      "description": "Scroll boundary where sticking begins: a length past the natural position (`%` of the element height), `true`/`parent` for the parent's inner bottom edge, or a selector for an element's edge.",
      "from": null,
      "name": "start",
      "property": "start",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "''",
      "description": "Scroll boundary where sticking stops: empty/`true`/`parent` for the parent's inner bottom, `false`/`none` for the document end, a length past the element, or a selector for an element's bottom edge.",
      "from": null,
      "name": "end",
      "property": "end",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "false",
      "description": "Only sticks while scrolling up; scrolling down hides the fixed element, playing the leave animation when `animation` is set.",
      "from": null,
      "name": "show-on-up",
      "property": "show-on-up",
      "reflect": false,
      "tokens": null,
      "type": "boolean",
      "values": null
    },
    {
      "default": "false",
      "description": "When the element is taller than the viewport, flips it to stick from the opposite edge so its far end stays reachable instead of scrolling the overflow.",
      "from": null,
      "name": "overflow-flip",
      "property": "overflow-flip",
      "reflect": false,
      "tokens": null,
      "type": "boolean",
      "values": null
    },
    {
      "default": "''",
      "description": "Animation preset played when the fixed element enters or leaves (with `show-on-up`, or when scrolling below its natural position).",
      "from": null,
      "name": "animation",
      "property": "animation",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "150",
      "description": "Animation duration in milliseconds; non-finite or negative values fall back to 150.",
      "from": null,
      "name": "duration",
      "property": "duration",
      "reflect": false,
      "tokens": null,
      "type": "number",
      "values": null
    },
    {
      "default": "''",
      "description": "Media query that enables sticking; accepts a full query, a breakpoint shorthand (`sm`, `md`, `lg`, `xl`, `2xl`), or a bare pixel number. When it stops matching, the element returns to its natural position and is marked inactive.",
      "from": null,
      "name": "media",
      "property": "media",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "''",
      "description": "Enables hash-navigation compensation: after jumping to an anchor, scrolls back so the sticky element does not cover the target. `true` adds no extra gap, a length adds clearance, and `false` disables it.",
      "from": null,
      "name": "target-offset",
      "property": "target-offset",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "''",
      "description": "CSS selector for a descendant that receives the active/inactive classes instead of the host.",
      "from": null,
      "name": "sel-target",
      "property": "sel-target",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "''",
      "description": "Adds classes to named parts as `key: classes` pairs; a plain string targets the default part.",
      "from": "Base",
      "name": "cls",
      "property": "cls",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "''",
      "description": "Adds inline styles to named parts as `key: styles` pairs; a plain string targets the default part.",
      "from": "Base",
      "name": "stl",
      "property": "stl",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    }
  ],
  "category": "layout",
  "children": [],
  "cssClasses": [
    {
      "appliesTo": "z-sticky",
      "class": ".z-sticky",
      "description": "Root class for a sticky element, also styled on the `z-sticky` host; creates the positioning and stacking context.",
      "role": "root"
    },
    {
      "appliesTo": ".z-sticky",
      "class": ".z-sticky-fixed",
      "description": "State class applied while the element is fixed; zeroes its margin so the fixed position matches the layout slot.",
      "role": "state"
    },
    {
      "appliesTo": ".z-sticky",
      "class": ".z-sticky-placeholder",
      "description": "Spacer inserted after the element while it is fixed to preserve the layout slot; pointer events are disabled so content beneath stays clickable.",
      "role": "element"
    }
  ],
  "cssVars": [],
  "dataHooks": [
    {
      "appliesTo": "descendant",
      "attribute": "data-fn",
      "description": "Marks a deferred `<template>` child whose content is mounted into the container on demand.",
      "from": "Controller",
      "role": "config",
      "values": [
        "template"
      ]
    }
  ],
  "events": [
    {
      "bubbles": true,
      "cancelable": false,
      "description": "Fires when the element starts sticking. Detail carries `fixed`, `below`, `scroll`, and `target`.",
      "detail": {
        "fields": [
          {
            "name": "fixed",
            "type": "boolean"
          },
          {
            "name": "below",
            "type": "boolean"
          },
          {
            "name": "scroll",
            "type": "number"
          },
          {
            "name": "target",
            "type": "HTMLElement"
          }
        ],
        "type": "{ fixed: boolean; below: boolean; scroll: number; target: HTMLElement }"
      },
      "name": "z-sticky:active"
    },
    {
      "bubbles": true,
      "cancelable": false,
      "description": "Fires on any active-state change; detail adds an `active` boolean to the `fixed`, `below`, `scroll`, and `target` fields.",
      "detail": {
        "fields": [
          {
            "name": "active",
            "type": "boolean"
          },
          {
            "name": "fixed",
            "type": "boolean"
          },
          {
            "name": "below",
            "type": "boolean"
          },
          {
            "name": "scroll",
            "type": "number"
          },
          {
            "name": "target",
            "type": "HTMLElement"
          }
        ],
        "type": "{ active: boolean; fixed: boolean; below: boolean; scroll: number; target: HTMLElement }"
      },
      "name": "z-sticky:change"
    },
    {
      "bubbles": true,
      "cancelable": false,
      "description": "Fires when the element stops sticking, with the same detail shape as `active`.",
      "detail": {
        "fields": [
          {
            "name": "fixed",
            "type": "boolean"
          },
          {
            "name": "below",
            "type": "boolean"
          },
          {
            "name": "scroll",
            "type": "number"
          },
          {
            "name": "target",
            "type": "HTMLElement"
          }
        ],
        "type": "{ fixed: boolean; below: boolean; scroll: number; target: HTMLElement }"
      },
      "name": "z-sticky:inactive"
    },
    {
      "bubbles": true,
      "cancelable": false,
      "description": "Fires when deferred template content is mounted into the container.",
      "detail": {
        "fields": [],
        "type": "Record<string, unknown>"
      },
      "from": "Controller",
      "name": "z-sticky:mount"
    }
  ],
  "i18n": [],
  "icons": [],
  "id": "sticky",
  "inherits": [
    "Controller",
    "Base"
  ],
  "keyboard": [],
  "kind": "controller",
  "methods": [
    {
      "description": "Returns whether the element is currently sticking.",
      "name": "isActive",
      "params": [],
      "returns": "boolean",
      "static": false
    },
    {
      "description": "Returns whether the page has scrolled past the element's natural position.",
      "name": "isBelow",
      "params": [],
      "returns": "boolean",
      "static": false
    },
    {
      "description": "Returns whether the element is currently `position: fixed` (as opposed to native sticky or static).",
      "name": "isFixed",
      "params": [],
      "returns": "boolean",
      "static": false
    },
    {
      "description": "Re-measures the element and viewport and re-syncs the sticky state.",
      "name": "refresh",
      "params": [],
      "returns": "void",
      "static": false
    }
  ],
  "notes": [
    "Uses native `position: sticky` when possible (top position, no `show-on-up`, no animation, default end, and no overflow-clipping ancestor); otherwise it fixes the element and inserts a placeholder.",
    "When the element is taller than the viewport, scrolling accumulates overflow so both ends stay reachable.",
    "A sticky element only sticks within its parent's box; the default `end` boundary is the parent's inner bottom edge."
  ],
  "parts": {
    "defaultClsTarget": "active",
    "defaultStlTarget": "host-inner",
    "items": [
      {
        "defaultCls": "z-active",
        "description": "Class applied while the element is sticking (or to `sel-target`); the default `cls` target for this component.",
        "foundIn": [
          "$cls"
        ],
        "key": "active",
        "supportsCls": true,
        "supportsStl": false
      },
      {
        "defaultCls": "z-sticky-below",
        "description": "Class applied once the page has scrolled past the element's natural position.",
        "foundIn": [
          "$cls"
        ],
        "key": "below",
        "supportsCls": true,
        "supportsStl": false
      },
      {
        "defaultCls": "z-sticky-fixed",
        "description": "Class applied while the element is `position: fixed` rather than native sticky.",
        "foundIn": [
          "$cls"
        ],
        "key": "fixed",
        "supportsCls": true,
        "supportsStl": false
      },
      {
        "defaultCls": "",
        "description": "Class applied while the element is not sticking; empty by default.",
        "foundIn": [
          "$cls"
        ],
        "key": "inactive",
        "supportsCls": true,
        "supportsStl": false
      }
    ]
  },
  "recipes": [],
  "related": [
    "scrollspy"
  ],
  "schemaVersion": 1,
  "sources": {
    "css": [
      "src/css/kit-components/sticky.css"
    ],
    "cssSelectors": [
      ".z-sticky",
      ".z-sticky-*"
    ],
    "ts": "src/js/controllers/components/sticky.ts"
  },
  "summary": "Sticks an element to the viewport edge on scroll, with start/end boundaries, show-on-up reveal, overflow handling, and native-sticky fallback.",
  "tag": "z-sticky",
  "title": "Sticky"
}
