{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "switch-label",
  "title": "Switch Label",
  "description": "Labeled switch with an optional description aligned to the control or the label text.",
  "registryDependencies": [
    "switch",
    "label"
  ],
  "files": [
    {
      "path": "components/dentil/switch-label/switch-label.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\n\nimport { Label } from '@/components/ui/label';\nimport { Switch } from '@/components/ui/switch';\nimport { cn } from '@/lib/utils';\n\nexport interface SwitchLabelProps extends React.ComponentProps<typeof Switch> {\n  label: React.ReactNode;\n  description?: React.ReactNode;\n  /** `switch` lines the description up with the control. `label` lines it up with the label text. */\n  alignDescription?: 'switch' | 'label';\n}\n\nexport function SwitchLabel({\n  className,\n  label,\n  description,\n  alignDescription = 'switch',\n  id: idProp,\n  disabled,\n  'aria-describedby': ariaDescribedBy,\n  ...props\n}: SwitchLabelProps) {\n  const generatedId = React.useId();\n  const id = idProp ?? generatedId;\n  const descriptionId = description ? `${id}-description` : undefined;\n  const describedBy = [descriptionId, ariaDescribedBy].filter(Boolean).join(' ') || undefined;\n\n  return (\n    <div\n      data-slot=\"switch-label\"\n      data-disabled={disabled ? '' : undefined}\n      className={cn('group grid grid-cols-[auto_minmax(0,1fr)] items-center gap-x-2 gap-y-1', className)}>\n      <Switch {...props} className=\"peer\" id={id} disabled={disabled} aria-describedby={describedBy} />\n      <Label htmlFor={id} className=\"min-h-8 cursor-pointer\">\n        {label}\n      </Label>\n      {description ? (\n        <p\n          id={descriptionId}\n          className={cn(\n            'text-muted-foreground text-sm leading-tight group-data-disabled:opacity-50 peer-disabled:opacity-50',\n            alignDescription === 'label' ? 'col-start-2' : 'col-span-2'\n          )}>\n          {description}\n        </p>\n      ) : null}\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/dentil/switch-label/switch-label.tsx"
    }
  ],
  "type": "registry:component"
}
