{
  "$schema": "https://rift-ds.com/schema/component.schema.json",
  "version": "1.40.0",
  "kind": "component",
  "name": "TopAppBar",
  "label": "Top app bar",
  "slug": "top-app-bar",
  "category": "navigation",
  "description": "Mobile screen header with a menu or back button, title, and actions, in Rift, iOS, or Android style, collapsing on scroll.",
  "client": true,
  "importPath": "rift-ds/components/TopAppBar/TopAppBar",
  "barrel": "main",
  "docsUrl": "https://rift-ds.com/components/top-app-bar",
  "markdownUrl": "https://rift-ds.com/components/top-app-bar.md",
  "exports": [
    {
      "component": "TopAppBar",
      "props": [
        {
          "name": "title",
          "type": "string",
          "typeKind": "primitive",
          "required": true,
          "description": "The screen's title.\nNote: this shadows the native `title` tooltip attribute, which TopAppBar does not expose."
        },
        {
          "name": "subtitle",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "A second line under the title, e.g. a count or a date range"
        },
        {
          "name": "platform",
          "type": "\"default\" | \"ios\" | \"android\"",
          "typeKind": "enum",
          "values": [
            "android",
            "default",
            "ios"
          ],
          "required": false,
          "description": "Which platform's bar to draw. `default` is the Rift bar; `ios` is the iOS\n26 navigation bar, with glass circle buttons over content and a soft\nblurred edge; `android` is the Material 3 Expressive top app bar.",
          "default": "default"
        },
        {
          "name": "size",
          "type": "\"small\" | \"large\" | \"medium\"",
          "typeKind": "enum",
          "values": [
            "large",
            "medium",
            "small"
          ],
          "required": false,
          "description": "`small` puts the title in the bar. `medium` and `large` add an expanded\ntitle under it that collapses into the bar as the page scrolls; on iOS\nboth are the large title.",
          "default": "small"
        },
        {
          "name": "align",
          "type": "\"center\" | \"start\"",
          "typeKind": "enum",
          "values": [
            "center",
            "start"
          ],
          "required": false,
          "description": "Title alignment in the bar. Defaults to centred on iOS and to the start edge elsewhere"
        },
        {
          "name": "navigation",
          "type": "\"menu\" | \"close\" | \"back\"",
          "typeKind": "enum",
          "values": [
            "back",
            "close",
            "menu"
          ],
          "required": false,
          "description": "The leading control: a menu button, a back button, or a close button"
        },
        {
          "name": "onNavigate",
          "type": "(() => void)",
          "typeKind": "function",
          "required": false,
          "description": "Called when the leading control is pressed"
        },
        {
          "name": "navigationLabel",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Accessible label of the leading control; defaults to \"Open menu\", \"Back\" or \"Close\""
        },
        {
          "name": "actions",
          "type": "TopAppBarAction[]",
          "typeKind": "array",
          "required": false,
          "description": "Trailing actions. The first three show as icon buttons; any more join the\noverflow menu, ahead of `overflowActions`, where they render as plain rows\n(a menu row draws no badge and routes from `onClick`, not `href`)",
          "defaultExpression": "[]",
          "typeRefs": [
            "TopAppBarAction"
          ]
        },
        {
          "name": "overflowActions",
          "type": "TopAppBarOverflowAction[]",
          "typeKind": "array",
          "required": false,
          "description": "Actions listed in a menu behind a trailing \"More\" button",
          "defaultExpression": "[]",
          "typeRefs": [
            "TopAppBarOverflowAction"
          ]
        },
        {
          "name": "overflowLabel",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Accessible label of the button that opens the overflow menu",
          "default": "More"
        },
        {
          "name": "badgeLabel",
          "type": "((label: string) => string)",
          "typeKind": "function",
          "required": false,
          "description": "The accessible name of an action that carries a `badge`, given the\naction's `label`. Defaults to \"<label>, new\", e.g. \"Notifications, new\".",
          "defaultExpression": "(label: string) => `${label}, new`"
        },
        {
          "name": "scrolled",
          "type": "boolean",
          "typeKind": "primitive",
          "required": false,
          "description": "Whether content has scrolled under the bar, which collapses an expanded\ntitle and switches the bar to its scrolled surface. Leave unset to have\nthe bar watch `scrollTarget` itself."
        },
        {
          "name": "scrollTarget",
          "type": "HTMLElement | null",
          "typeKind": "other",
          "required": false,
          "description": "The element whose scroll the bar watches when `scrolled` is unset. Defaults to the window"
        },
        {
          "name": "headingLevel",
          "type": "1 | 2 | 4 | 3 | 5 | 6",
          "typeKind": "enum",
          "values": [
            "1",
            "2",
            "3",
            "4",
            "5",
            "6"
          ],
          "required": false,
          "description": "Level of the title's heading element",
          "default": 1
        },
        {
          "name": "sticky",
          "type": "boolean",
          "typeKind": "primitive",
          "required": false,
          "description": "Keeps the bar stuck to the top of its scroll container",
          "default": true
        },
        {
          "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} />`."
    },
    "TopAppBarAction": {
      "kind": "interface",
      "definition": "interface TopAppBarAction {\n  /** Unique key for this action */\n  key: string;\n  /** Icon — Material Symbol name (string) or custom element (ReactNode) */\n  icon: string | React.ReactNode;\n  /** Accessible label; also the overflow menu's row text */\n  label: string;\n  /** Click handler */\n  onClick?: () => void;\n  /** Renders the action as a link to this URL instead of a button */\n  href?: string;\n  /** Shows a dot on the icon's corner, e.g. unread notifications */\n  badge?: boolean;\n}"
    },
    "TopAppBarOverflowAction": {
      "kind": "type",
      "definition": "type TopAppBarOverflowAction = Omit<TopAppBarAction, 'href' | 'badge'>;",
      "description": "An action in the overflow menu. The menu's rows are buttons and draw no\nicon badge, so `href` and `badge` are left out rather than silently\ndropped: route from `onClick` instead.",
      "refs": [
        "TopAppBarAction"
      ]
    }
  },
  "externalTypes": {
    "ComponentPropsWithRef": "react",
    "ElementType": "react",
    "HTMLElement": "typescript",
    "Omit": "typescript",
    "ReactNode": "react"
  },
  "keyboard": [
    {
      "pattern": "button",
      "part": "buttons",
      "label": "Button",
      "apg": "https://www.w3.org/WAI/ARIA/apg/patterns/button/",
      "rows": [
        {
          "keys": [
            "Enter"
          ],
          "text": "Activates the button."
        },
        {
          "keys": [
            "Space"
          ],
          "text": "Activates the button."
        }
      ]
    }
  ],
  "size": {
    "gzip": 10131
  }
}
