{
  "schemaVersion": 1,
  "target": "react",
  "name": "separator",
  "version": "0.1.0",
  "category": "feedback",
  "title": "Separator",
  "description": "A horizontal or vertical divider line on Base UI Separator, with an optional label at the start, middle, or end.",
  "tags": [
    "divider",
    "rule",
    "hr",
    "line",
    "layout"
  ],
  "requires": {
    "projectTypes": [
      "next",
      "vite-react"
    ],
    "styling": "tailwind-v4"
  },
  "npmDependencies": {
    "@base-ui/react": "^1.9.0"
  },
  "registryDependencies": [],
  "docsPath": "/components/separator",
  "props": [
    {
      "name": "orientation",
      "type": "\"horizontal\" | \"vertical\"",
      "default": "\"horizontal\"",
      "description": "Horizontal spans the width; vertical stretches to the height of its flex row."
    },
    {
      "name": "label",
      "type": "ReactNode",
      "description": "Text or an icon drawn in a gap in the line, such as \"or\" or a date."
    },
    {
      "name": "labelPosition",
      "type": "\"start\" | \"center\" | \"end\"",
      "default": "\"center\"",
      "description": "Where the label sits along the line."
    },
    {
      "name": "strength",
      "type": "\"divider\" | \"hairline\"",
      "default": "\"divider\"",
      "description": "divider is the quiet line used inside containers; hairline matches container borders."
    },
    {
      "name": "variant",
      "type": "\"solid\" | \"dashed\" | \"dotted\"",
      "default": "\"solid\"",
      "description": "Line style."
    },
    {
      "name": "decorative",
      "type": "boolean",
      "default": "false",
      "description": "Sets role=\"none\" for lines that are purely visual, so screen readers skip them."
    }
  ],
  "accessibility": [
    "Renders role=\"separator\" with aria-orientation through Base UI Separator.",
    "A string label also becomes the separator's aria-label, so it is announced once.",
    "decorative switches the role to none for lines that only add visual rhythm.",
    "Not focusable and has no motion."
  ],
  "states": [
    "horizontal",
    "vertical",
    "labeled",
    "dotted"
  ],
  "files": [
    {
      "path": "ui/separator.tsx",
      "content": "\"use client\";\n\nimport { Separator as BaseSeparator } from \"@base-ui/react/separator\";\nimport type { ReactNode } from \"react\";\n\nfunction cx(...classes: (string | false | null | undefined)[]) {\n  return classes.filter(Boolean).join(\" \");\n}\n\n// `divider` is the quiet line inside containers; `hairline` matches container borders.\n// Dashed and dotted lines are mostly gaps, so they draw a step stronger to read at the same weight.\nconst strengths = {\n  divider: {\n    solid: \"border-zinc-950/[0.07] dark:border-white/[0.08]\",\n    broken: \"border-zinc-950/15 dark:border-white/[0.18]\",\n  },\n  hairline: {\n    solid: \"border-zinc-950/10 dark:border-white/12\",\n    broken: \"border-zinc-950/20 dark:border-white/25\",\n  },\n} as const;\n\nconst styles = {\n  solid: \"border-solid\",\n  dashed: \"border-dashed\",\n  dotted: \"border-dotted\",\n} as const;\n\nexport interface SeparatorProps extends Omit<BaseSeparator.Props, \"className\" | \"children\"> {\n  className?: string;\n  /** `horizontal` spans the width; `vertical` stretches to the height of a flex row. */\n  orientation?: \"horizontal\" | \"vertical\";\n  /** Text or an icon in the middle of the line, such as \"or\" or a date. */\n  label?: ReactNode;\n  /** Where the label sits along the line. */\n  labelPosition?: \"start\" | \"center\" | \"end\";\n  /** `divider` (default) for inside containers, `hairline` to match a container border. */\n  strength?: keyof typeof strengths;\n  /** Line style. Dotted echoes the dot language of the agent marks. */\n  variant?: keyof typeof styles;\n  /**\n   * Purely visual lines (inside a menu row, between toolbar icons that are already grouped)\n   * can opt out of the separator role so screen readers skip them.\n   */\n  decorative?: boolean;\n}\n\n/**\n * A horizontal or vertical line that divides content, with an optional label in the middle.\n * Without a label it is a Base UI Separator (`role=\"separator\"` and `aria-orientation`).\n */\nexport function Separator({\n  orientation = \"horizontal\",\n  label,\n  labelPosition = \"center\",\n  strength = \"divider\",\n  variant = \"solid\",\n  decorative = false,\n  className,\n  ...props\n}: SeparatorProps) {\n  const vertical = orientation === \"vertical\";\n  const tone = strengths[strength][variant === \"solid\" ? \"solid\" : \"broken\"];\n  const line = cx(\n    tone,\n    styles[variant],\n    vertical ? \"w-0 self-stretch border-l\" : \"h-0 w-full border-t\",\n  );\n  // Only override Base UI's role=\"separator\" when asked; passing role={undefined} would erase it.\n  const roleProps = decorative ? { role: \"none\" } : {};\n\n  if (label == null || label === false) {\n    return (\n      <BaseSeparator\n        orientation={orientation}\n        {...roleProps}\n        className={cx(\"shrink-0\", line, vertical && \"min-h-4\", className)}\n        {...props}\n      />\n    );\n  }\n\n  // With a label the lines are drawn on each side. A string label also names the separator,\n  // so a screen reader hears it once (separator children are presentational).\n  const segment = cx(\"flex-1\", tone, styles[variant], vertical ? \"w-0 border-l\" : \"h-0 border-t\");\n  return (\n    <BaseSeparator\n      orientation={orientation}\n      {...roleProps}\n      aria-label={typeof label === \"string\" && !decorative ? label : undefined}\n      className={cx(\n        \"flex shrink-0 items-center\",\n        vertical ? \"min-h-16 flex-col gap-2 self-stretch\" : \"w-full gap-3\",\n        className,\n      )}\n      {...props}\n    >\n      <span aria-hidden=\"true\" className={cx(segment, labelPosition === \"start\" && (vertical ? \"max-h-3\" : \"max-w-4\"))} />\n      <span\n        className={cx(\n          \"inline-flex shrink-0 items-center gap-1.5 text-xs leading-4 font-medium whitespace-nowrap text-zinc-500 [&_svg]:size-3.5\",\n          vertical && \"[writing-mode:horizontal-tb]\",\n        )}\n      >\n        {label}\n      </span>\n      <span aria-hidden=\"true\" className={cx(segment, labelPosition === \"end\" && (vertical ? \"max-h-3\" : \"max-w-4\"))} />\n    </BaseSeparator>\n  );\n}\n"
    }
  ],
  "example": {
    "content": "import { Separator } from \"@/components/shaken/ui/separator\";\n\nconst field = \"flex h-9 items-center rounded-lg border border-zinc-950/12 px-3 text-sm dark:border-white/15\";\n\nexport default function SeparatorExample() {\n  return (\n    <div className=\"grid w-full max-w-md gap-8\">\n      <div className=\"grid gap-3 rounded-xl border border-zinc-950/10 p-5 dark:border-white/10\">\n        <div className={`${field} justify-center font-medium text-zinc-950 dark:text-white`}>Continue with GitHub</div>\n        <Separator label=\"or\" />\n        <div className={`${field} text-zinc-500`}>name@company.com</div>\n      </div>\n\n      <div className=\"grid gap-3 text-sm\">\n        <p className=\"text-zinc-950 dark:text-white\">Deployed main to production</p>\n        <Separator label=\"Yesterday\" labelPosition=\"start\" variant=\"dotted\" />\n        <p className=\"text-zinc-950 dark:text-white\">Rolled back preview build 1842</p>\n      </div>\n\n      <div className=\"flex h-5 items-center gap-3 text-sm text-zinc-600 dark:text-zinc-400\">\n        <span>Docs</span>\n        <Separator orientation=\"vertical\" />\n        <span>Changelog</span>\n        <Separator orientation=\"vertical\" />\n        <span className=\"font-mono text-xs tabular-nums\">v2.4.1</span>\n      </div>\n    </div>\n  );\n}\n"
  }
}
