{
  "$schema": "https://design.senvenli.com/schema/component.full.json",
  "kind": "component",
  "family": "navigation",
  "status": "alpha",
  "import": "@senvenli/react/navigation",
  "name": "tabs",
  "title": "Tabs",
  "exports": [
    "Tabs",
    "TabList",
    "Tab",
    "TabPanel",
    "SegmentedControl"
  ],
  "description": "Switches between views of the same content; SegmentedControl switches a small set of options inline.",
  "keywords": [
    "compound",
    "segmented control",
    "switch",
    "tab panel",
    "tablist",
    "tabs",
    "views"
  ],
  "usage": {
    "when": [
      "Two to seven views of one thing: Overview, Activity, Settings."
    ],
    "instead": [
      {
        "use": "toggle-button",
        "when": "Options act on content instead of switching views."
      }
    ]
  },
  "a11y": {
    "keyboard": [
      {
        "keys": "Arrow keys",
        "does": "Moves between tabs."
      }
    ],
    "builtIn": [
      "Tabs and panels are linked; counts are announced."
    ],
    "youProvide": [
      "Short nouns for tab labels.",
      "With children: one TabPanel per Tab, matched by the same id, and an aria-label on TabList when no heading names it."
    ]
  },
  "related": [
    "toggle-button"
  ],
  "genui": {
    "expose": true,
    "description": "Tabs switching between views. items are {id, label, count?, panel?}; panel is the tab's text content. Emits change.",
    "props": [
      "items",
      "defaultSelectedKey"
    ],
    "children": "none",
    "events": [
      "change"
    ],
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "count": {
                "type": "number"
              },
              "isDisabled": {
                "type": "boolean"
              },
              "panel": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "label",
              "panel"
            ]
          },
          "description": "Two to six tabs as data. Leave it out and compose `TabList`, `Tab` and `TabPanel` as children instead,\nfor a tab with an icon, a panel built elsewhere, or tabs rendered from your own components."
        },
        "defaultSelectedKey": {
          "type": "string"
        }
      }
    }
  },
  "source": [
    "src/navigation/tabs.tsx"
  ],
  "props": {
    "Tabs": [
      {
        "name": "items",
        "type": "readonly TabItem[]",
        "required": false,
        "origin": "own",
        "description": "Two to six tabs as data. Leave it out and compose `TabList`, `Tab` and `TabPanel` as children instead,\nfor a tab with an icon, a panel built elsewhere, or tabs rendered from your own components.",
        "schema": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "count": {
                "type": "number"
              },
              "isDisabled": {
                "type": "boolean"
              },
              "panel": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "label",
              "panel"
            ]
          }
        }
      },
      {
        "name": "children",
        "type": "React.ReactNode",
        "required": false,
        "origin": "own",
        "description": "With no `items`: a `TabList` of `Tab`s followed by one `TabPanel` per tab, matched by `id`."
      },
      {
        "name": "selectedKey",
        "type": "Key",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "defaultSelectedKey",
        "type": "Key",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "onSelectionChange",
        "type": "(key: Key) => void",
        "required": false,
        "origin": "own"
      },
      {
        "name": "aria-label",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "Names the tab list when no heading above it does (with `items`; on `TabList` otherwise).",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "variant",
        "type": "TabsVariant",
        "required": false,
        "origin": "own",
        "description": "`underline` (default): a line under the selected tab; `pills`: a filled tab; `outline`: a framed tab.",
        "schema": {
          "type": "string",
          "enum": [
            "underline",
            "outline",
            "pills"
          ]
        }
      },
      {
        "name": "orientation",
        "type": "\"horizontal\" | \"vertical\"",
        "required": false,
        "origin": "own",
        "description": "`horizontal` (default), or `vertical`: the tabs in a column beside the panels (settings pages).",
        "schema": {
          "type": "string",
          "enum": [
            "horizontal",
            "vertical"
          ]
        }
      },
      {
        "name": "size",
        "type": "ComponentSize",
        "required": false,
        "origin": "own",
        "description": "`small`, `medium` (default) or `large`; the provider default otherwise.",
        "schema": {
          "type": "string",
          "enum": [
            "small",
            "medium",
            "large"
          ]
        }
      },
      {
        "name": "motion",
        "type": "ComponentMotion",
        "required": false,
        "origin": "own",
        "description": "`auto` (follow the device), `reduce` or `none`, for this component; the provider's setting otherwise.",
        "schema": {
          "type": "string",
          "enum": [
            "none",
            "auto",
            "reduce"
          ]
        }
      }
    ],
    "TabList": [
      {
        "name": "children",
        "type": "React.ReactNode",
        "required": true,
        "origin": "own",
        "description": "`Tab` elements."
      },
      {
        "name": "aria-label",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "Names the tab list when no heading above it does.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "aria-labelledby",
        "type": "string",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "string"
        }
      }
    ],
    "Tab": [
      {
        "name": "id",
        "type": "Key",
        "required": true,
        "origin": "own",
        "description": "Matches the `TabPanel` with the same `id`.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "children",
        "type": "React.ReactNode",
        "required": true,
        "origin": "own",
        "description": "The label: a noun, one or two words, optionally with an Icon before it."
      },
      {
        "name": "count",
        "type": "number",
        "required": false,
        "origin": "own",
        "description": "A count after the label (a Badge); hidden at 0.",
        "schema": {
          "type": "number"
        }
      },
      {
        "name": "isDisabled",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "boolean"
        }
      }
    ],
    "TabPanel": [
      {
        "name": "id",
        "type": "Key",
        "required": true,
        "origin": "own",
        "description": "Matches the `Tab` with the same `id`.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "children",
        "type": "React.ReactNode",
        "required": true,
        "origin": "own"
      }
    ],
    "SegmentedControl": [
      {
        "name": "label",
        "type": "string",
        "required": true,
        "origin": "own",
        "description": "Names the group for assistive tech (\"Period\"); it is not shown.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "items",
        "type": "readonly SegmentedControlItem[]",
        "required": true,
        "origin": "own",
        "description": "Two to five short options (\"Day\", \"Week\", \"Month\").",
        "schema": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "label": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "label"
            ]
          }
        }
      },
      {
        "name": "value",
        "type": "Key",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "defaultValue",
        "type": "Key",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "onChange",
        "type": "(value: Key) => void",
        "required": false,
        "origin": "own"
      },
      {
        "name": "isDisabled",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "boolean"
        }
      }
    ]
  },
  "tokens": [
    "ds-background-neutral",
    "ds-background-segment-selected",
    "ds-border",
    "ds-border-bold",
    "ds-border-focused",
    "ds-border-selected",
    "ds-easing-standard",
    "ds-radius-control-medium",
    "ds-radius-medium",
    "ds-radius-small",
    "ds-shadow-raised",
    "ds-space-050",
    "ds-space-075",
    "ds-space-100",
    "ds-space-150",
    "ds-space-200",
    "ds-space-300",
    "ds-space-400",
    "ds-text",
    "ds-text-disabled",
    "ds-text-subtle"
  ],
  "strings": [],
  "quality": {
    "tests": true,
    "a11y": false,
    "docs": false,
    "visual": false,
    "dark": false,
    "rtl": false,
    "mcp": true,
    "generic": true
  }
}
