{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dropdown-menu",
  "type": "registry:ui",
  "title": "Dropdown Menu",
  "description": "A menu of actions that opens from a button: items, checkbox and radio items, labels, separators, sub-menus and a shortcut slot.",
  "categories": [
    "ui"
  ],
  "dependencies": [
    "lucide-react",
    "radix-ui"
  ],
  "registryDependencies": [
    "@rivier-ui/theme",
    "@rivier-ui/cn"
  ],
  "files": [
    {
      "path": "registry/ui/dropdown-menu.tsx",
      "type": "registry:ui",
      "target": "components/ui/dropdown-menu.tsx",
      "content": "\"use client\";\n/**\n * @name dropdown-menu\n * @category ui\n * @description A menu of actions that opens from a button: items, checkbox and radio items, labels, separators, sub-menus and a shortcut slot.\n * @when A list of actions or options behind one button (an account menu, \"more\" on a row). For choosing one value in a form use select; for actions on right-click use context-menu; for free content use popover. An icon-only trigger needs an `aria-label`.\n * @example\n * <DropdownMenu>\n *   <DropdownMenuTrigger asChild><Button variant=\"outline\">Options</Button></DropdownMenuTrigger>\n *   <DropdownMenuContent align=\"start\">\n *     <DropdownMenuLabel>Project</DropdownMenuLabel>\n *     <DropdownMenuItem>Rename <DropdownMenuShortcut>F2</DropdownMenuShortcut></DropdownMenuItem>\n *     <DropdownMenuCheckboxItem checked>Show in sidebar</DropdownMenuCheckboxItem>\n *     <DropdownMenuSub>\n *       <DropdownMenuSubTrigger>Move to</DropdownMenuSubTrigger>\n *       <DropdownMenuSubContent>\n *         <DropdownMenuRadioGroup value=\"work\">\n *           <DropdownMenuRadioItem value=\"work\">Work</DropdownMenuRadioItem>\n *           <DropdownMenuRadioItem value=\"archive\">Archive</DropdownMenuRadioItem>\n *         </DropdownMenuRadioGroup>\n *       </DropdownMenuSubContent>\n *     </DropdownMenuSub>\n *     <DropdownMenuSeparator />\n *     <DropdownMenuItem variant=\"destructive\">Delete</DropdownMenuItem>\n *   </DropdownMenuContent>\n * </DropdownMenu>\n */\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { Check, ChevronRight, Circle } from \"lucide-react\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\n/* The highlight (Radix's data-highlighted, which follows both pointer and keyboard) is the ground; the theme's\n   focus ring stays for keyboard users and is drawn inside the item so the menu's edge does not clip it. */\nconst item =\n  \"relative flex min-h-9 cursor-default items-center gap-2 rounded-control px-2.5 py-1.5 text-sm select-none -outline-offset-2 data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-accent data-highlighted:text-accent-foreground pointer-coarse:min-h-10 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\";\n\nconst surface =\n  \"z-50 min-w-40 overflow-x-hidden overflow-y-auto rounded-surface border bg-popover p-1 text-popover-foreground ease-out animation-duration-(--duration-base) fade-in-0 fade-out-0 zoom-in-95 zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=open]:animate-in motion-reduce:animate-none!\";\n\nexport function DropdownMenu(props: ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n  return <DropdownMenuPrimitive.Root {...props} />;\n}\n\nexport function DropdownMenuTrigger(props: ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n  return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nexport function DropdownMenuContent({ className, sideOffset = 6, collisionPadding = 8, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n  return (\n    <DropdownMenuPrimitive.Portal>\n      <DropdownMenuPrimitive.Content\n        data-slot=\"dropdown-menu-content\"\n        sideOffset={sideOffset}\n        collisionPadding={collisionPadding}\n        className={cn(\n          surface,\n          \"max-h-(--radix-dropdown-menu-content-available-height) max-w-(--radix-dropdown-menu-content-available-width) origin-(--radix-dropdown-menu-content-transform-origin)\",\n          className,\n        )}\n        {...props}\n      />\n    </DropdownMenuPrimitive.Portal>\n  );\n}\n\nexport function DropdownMenuGroup(props: ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n  return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nexport type DropdownMenuItemProps = ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n  /** Indent to line up with checkbox and radio items in the same menu. */\n  inset?: boolean;\n  /** \"destructive\" only for deleting. */\n  variant?: \"default\" | \"destructive\";\n};\n\nexport function DropdownMenuItem({ className, inset = false, variant = \"default\", ...props }: DropdownMenuItemProps) {\n  return (\n    <DropdownMenuPrimitive.Item\n      data-slot=\"dropdown-menu-item\"\n      data-variant={variant}\n      className={cn(item, inset && \"ps-8\", variant === \"destructive\" && \"text-destructive data-highlighted:text-destructive\", className)}\n      {...props}\n    />\n  );\n}\n\nexport function DropdownMenuCheckboxItem({ className, children, ...props }: ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n  return (\n    <DropdownMenuPrimitive.CheckboxItem data-slot=\"dropdown-menu-checkbox-item\" className={cn(item, \"ps-8\", className)} {...props}>\n      <span aria-hidden=\"true\" className=\"pointer-events-none absolute start-2.5 flex size-4 items-center justify-center\">\n        <DropdownMenuPrimitive.ItemIndicator>\n          <Check strokeWidth={1.5} className=\"size-4\" />\n        </DropdownMenuPrimitive.ItemIndicator>\n      </span>\n      {children}\n    </DropdownMenuPrimitive.CheckboxItem>\n  );\n}\n\nexport function DropdownMenuRadioGroup(props: ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n  return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nexport function DropdownMenuRadioItem({ className, children, ...props }: ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n  return (\n    <DropdownMenuPrimitive.RadioItem data-slot=\"dropdown-menu-radio-item\" className={cn(item, \"ps-8\", className)} {...props}>\n      <span aria-hidden=\"true\" className=\"pointer-events-none absolute start-2.5 flex size-4 items-center justify-center\">\n        <DropdownMenuPrimitive.ItemIndicator>\n          <Circle strokeWidth={1.5} className=\"size-2 fill-current\" />\n        </DropdownMenuPrimitive.ItemIndicator>\n      </span>\n      {children}\n    </DropdownMenuPrimitive.RadioItem>\n  );\n}\n\nexport function DropdownMenuLabel({ className, inset = false, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Label> & { inset?: boolean }) {\n  return (\n    <DropdownMenuPrimitive.Label\n      data-slot=\"dropdown-menu-label\"\n      className={cn(\"px-2.5 py-1.5 text-xs font-medium text-muted-foreground\", inset && \"ps-8\", className)}\n      {...props}\n    />\n  );\n}\n\nexport function DropdownMenuSeparator({ className, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n  return <DropdownMenuPrimitive.Separator data-slot=\"dropdown-menu-separator\" className={cn(\"-mx-1 my-1 h-px bg-border\", className)} {...props} />;\n}\n\n/** A keyboard hint at the end of an item. It only shows the keys: bind them yourself. */\nexport function DropdownMenuShortcut({ className, ...props }: ComponentProps<\"span\">) {\n  return <span data-slot=\"dropdown-menu-shortcut\" className={cn(\"ms-auto ps-4 text-xs tracking-widest text-muted-foreground\", className)} {...props} />;\n}\n\nexport function DropdownMenuSub(props: ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n  return <DropdownMenuPrimitive.Sub {...props} />;\n}\n\nexport function DropdownMenuSubTrigger({ className, inset = false, children, ...props }: ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & { inset?: boolean }) {\n  return (\n    <DropdownMenuPrimitive.SubTrigger\n      data-slot=\"dropdown-menu-sub-trigger\"\n      className={cn(item, \"data-[state=open]:bg-accent\", inset && \"ps-8\", className)}\n      {...props}\n    >\n      {children}\n      <ChevronRight aria-hidden=\"true\" strokeWidth={1.5} className=\"ms-auto size-4 rtl:rotate-180\" />\n    </DropdownMenuPrimitive.SubTrigger>\n  );\n}\n\nexport function DropdownMenuSubContent({ className, collisionPadding = 8, ...props }: ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n  return (\n    <DropdownMenuPrimitive.Portal>\n      <DropdownMenuPrimitive.SubContent\n        data-slot=\"dropdown-menu-sub-content\"\n        collisionPadding={collisionPadding}\n        className={cn(\n          surface,\n          \"max-h-(--radix-dropdown-menu-content-available-height) max-w-(--radix-dropdown-menu-content-available-width) origin-(--radix-dropdown-menu-content-transform-origin)\",\n          className,\n        )}\n        {...props}\n      />\n    </DropdownMenuPrimitive.Portal>\n  );\n}\n"
    }
  ],
  "meta": {
    "category": "ui",
    "when": "A list of actions or options behind one button (an account menu, \"more\" on a row). For choosing one value in a form use select; for actions on right-click use context-menu; for free content use popover. An icon-only trigger needs an `aria-label`.",
    "example": "<DropdownMenu>\n  <DropdownMenuTrigger asChild><Button variant=\"outline\">Options</Button></DropdownMenuTrigger>\n  <DropdownMenuContent align=\"start\">\n    <DropdownMenuLabel>Project</DropdownMenuLabel>\n    <DropdownMenuItem>Rename <DropdownMenuShortcut>F2</DropdownMenuShortcut></DropdownMenuItem>\n    <DropdownMenuCheckboxItem checked>Show in sidebar</DropdownMenuCheckboxItem>\n    <DropdownMenuSub>\n      <DropdownMenuSubTrigger>Move to</DropdownMenuSubTrigger>\n      <DropdownMenuSubContent>\n        <DropdownMenuRadioGroup value=\"work\">\n          <DropdownMenuRadioItem value=\"work\">Work</DropdownMenuRadioItem>\n          <DropdownMenuRadioItem value=\"archive\">Archive</DropdownMenuRadioItem>\n        </DropdownMenuRadioGroup>\n      </DropdownMenuSubContent>\n    </DropdownMenuSub>\n    <DropdownMenuSeparator />\n    <DropdownMenuItem variant=\"destructive\">Delete</DropdownMenuItem>\n  </DropdownMenuContent>\n</DropdownMenu>",
    "client": true
  }
}
