{
  "$schema": "https://rift-ds.com/schema/component.schema.json",
  "version": "1.40.0",
  "kind": "component",
  "name": "SubNavPanel",
  "label": "Sub-nav panel",
  "slug": "sub-nav-panel",
  "category": "layout",
  "description": "Secondary navigation column listing one section's pages, with group headings and one level of accordion nesting.",
  "client": true,
  "importPath": "rift-ds/components/SubNavPanel/SubNavPanel",
  "barrel": "main",
  "docsUrl": "https://rift-ds.com/components/sub-nav-panel",
  "markdownUrl": "https://rift-ds.com/components/sub-nav-panel.md",
  "exports": [
    {
      "component": "SubNavPanel",
      "props": [
        {
          "name": "items",
          "type": "SubNavPanelItem[]",
          "typeKind": "array",
          "required": true,
          "description": "Items to list, optionally grouped with `group` and nested one level with `children`",
          "typeRefs": [
            "SubNavPanelItem"
          ]
        },
        {
          "name": "title",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Heading at the top of the panel, usually the label of the item that opened it. Also the panel's accessible name, after a native `aria-label`; with neither, the panel is named \"Section navigation\".\nNote: this shadows the native `title` tooltip attribute, which SubNavPanel does not expose."
        },
        {
          "name": "activeKey",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Key of the item for the current page. Its accordion parent starts open"
        },
        {
          "name": "defaultOpenKeys",
          "type": "string[]",
          "typeKind": "array",
          "required": false,
          "description": "Keys of the accordion rows open on first render, in addition to the active item's parent"
        },
        {
          "name": "onCollapse",
          "type": "(() => void)",
          "typeKind": "function",
          "required": false,
          "description": "Renders a collapse button beside the heading and calls this when it is pressed"
        },
        {
          "name": "collapseLabel",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Accessible name of the collapse button. Defaults to \"Collapse <title>\", or \"Collapse panel\" when there is no title"
        },
        {
          "name": "onBack",
          "type": "(() => void)",
          "typeKind": "function",
          "required": false,
          "description": "Renders a back row above the heading and calls this when it is pressed, for a host that drills into the panel as a screen of its own"
        },
        {
          "name": "backLabel",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Label of the back row",
          "default": "Back"
        },
        {
          "name": "className",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Additional CSS classes",
          "default": ""
        },
        {
          "name": "linkComponent",
          "type": "LinkComponent",
          "typeKind": "reference",
          "required": false,
          "description": "The component its links render with, such as Next.js's `Link`, so they\nnavigate through the app's router. Wins over a LinkProvider's; a plain\n`<a>` when neither is set.",
          "typeRefs": [
            "LinkComponent"
          ]
        }
      ]
    }
  ],
  "types": {
    "LinkComponent": {
      "kind": "type",
      "definition": "type LinkComponent = React.ElementType<LinkComponentProps>;",
      "description": "A component that renders a link in place of a plain `<a>`, such as a router's.",
      "refs": [
        "LinkComponentProps"
      ]
    },
    "LinkComponentProps": {
      "kind": "type",
      "definition": "type LinkComponentProps = React.ComponentPropsWithRef<'a'> & { href: string };",
      "description": "The props a link component receives: every anchor attribute, the ref, and\nan `href` that is always a string. Next.js's `Link` takes these as they\nare; a router whose link takes `to` instead needs a one-line adapter:\n`({ href, ...props }) => <RouterLink to={href} {...props} />`."
    },
    "SubNavPanelItem": {
      "kind": "interface",
      "definition": "interface SubNavPanelItem {\n  /** Unique key for this item */\n  key: string;\n  /** Display label */\n  label: string;\n  /** Renders the item as a real link to this URL instead of a button. Ignored when the item has children, whose row is the accordion toggle */\n  href?: string;\n  /** Click handler — also fires on a link item, so a consumer can route client-side */\n  onClick?: () => void;\n  /** Trailing pill, e.g. unread items. A count takes the count badge colours; a word stays a quiet pill */\n  badge?: string | number;\n  /** A second line under the label, such as what a choice does */\n  description?: string;\n  /** Icon before the label: a Material Symbol name (string) or a custom element, such as a swatch */\n  icon?: string | React.ReactNode;\n  /** In a list of choices, whether this row is the chosen one: true carries the chosen mark, and either value sets `aria-pressed`. Picking a choice is an action, so the panel stays open */\n  selected?: boolean;\n  /** Group heading this item sits under; consecutive items sharing a group render beneath one heading */\n  group?: string;\n  /** Nested items — turns this row into an accordion. One level deep: grandchildren are not rendered */\n  children?: SubNavPanelItem[];\n}"
    }
  },
  "externalTypes": {
    "ComponentPropsWithRef": "react",
    "ElementType": "react",
    "ReactNode": "react"
  },
  "keyboard": [
    {
      "pattern": "disclosure",
      "part": "collapsible section",
      "label": "Disclosure",
      "apg": "https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/",
      "rows": [
        {
          "keys": [
            "Enter"
          ],
          "text": "Opens what it controls, and closes it when it is open."
        },
        {
          "keys": [
            "Space"
          ],
          "text": "Does the same as Enter."
        }
      ]
    }
  ],
  "size": {
    "gzip": 6253
  }
}
