{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "toggle",
  "type": "registry:ui",
  "title": "Toggle",
  "description": "A button that stays pressed: on or off.",
  "categories": [
    "ui"
  ],
  "dependencies": [
    "class-variance-authority",
    "radix-ui"
  ],
  "registryDependencies": [
    "@rivier-ui/theme",
    "@rivier-ui/cn"
  ],
  "files": [
    {
      "path": "registry/ui/toggle.tsx",
      "type": "registry:ui",
      "target": "components/ui/toggle.tsx",
      "content": "\"use client\";\n/**\n * @name toggle\n * @category ui\n * @description A button that stays pressed: on or off.\n * @when A toolbar state such as bold, mute or pin. For a setting use switch; for several toggles that belong together, or a pick-one row, use toggle-group.\n * @example\n * <Toggle aria-label=\"Italic\"><Italic strokeWidth={1.5} /></Toggle>\n * <Toggle variant=\"outline\" size=\"sm\" defaultPressed>Pinned</Toggle>\n */\nimport { Toggle as TogglePrimitive } from \"radix-ui\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\nexport const toggleVariants = cva(\n  \"inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-control text-sm font-medium text-foreground transition-[background-color,border-color,color,opacity] duration-instant ease-out select-none disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive data-[state=off]:hover:bg-accent data-[state=on]:bg-primary data-[state=on]:text-primary-foreground motion-reduce:transition-none [&_svg]:size-4 [&_svg]:shrink-0\",\n  {\n    variants: {\n      variant: {\n        ghost: \"border border-transparent\",\n        outline: \"border border-input bg-background data-[state=on]:border-primary\",\n      },\n      size: {\n        sm: \"h-control-sm min-w-(--control-h-sm) px-2\",\n        md: \"h-control min-w-(--control-h) px-2.5\",\n        lg: \"h-control-lg min-w-(--control-h-lg) px-3 text-base\",\n      },\n    },\n    defaultVariants: { variant: \"ghost\", size: \"md\" },\n  },\n);\n\nexport type ToggleProps = ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>;\n\nexport function Toggle({ className, variant, size, ...props }: ToggleProps) {\n  return <TogglePrimitive.Root data-slot=\"toggle\" className={cn(toggleVariants({ variant, size }), className)} {...props} />;\n}\n"
    }
  ],
  "meta": {
    "category": "ui",
    "when": "A toolbar state such as bold, mute or pin. For a setting use switch; for several toggles that belong together, or a pick-one row, use toggle-group.",
    "example": "<Toggle aria-label=\"Italic\"><Italic strokeWidth={1.5} /></Toggle>\n<Toggle variant=\"outline\" size=\"sm\" defaultPressed>Pinned</Toggle>",
    "client": true
  }
}
