BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/optics/dropdown-menu

Dropdown Menu

optics/dropdown-menu
FreeComponent

Displays a menu to the user — such as a set of actions or functions — triggered by a button.

See it running

Open the demo on optics

optics.agusmayol.com.ar/components/dropdown-menu
Open
This registry sends X-Frame-Options, so its page cannot be embedded here. The link is the same page the frame would have shown.

Install it

npx shadcn@latest add https://optics.agusmayol.com.ar/r/dropdown-menu.json

Source

registry/optics/dropdown-menu.jsxoptics.agusmayol.com.ar/r/dropdown-menu.json · first 6 KB
1"use client";
2
3import * as React from "react";
4import { Menu as MenuPrimitive } from "@base-ui/react/menu";
5
6import { cn } from "@/lib/utils";
7import { ChevronRightIcon, CheckIcon } from "lucide-react";
8
9function DropdownMenu({ ...props } = {}) {
10 return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
11}
12
13function DropdownMenuPortal({ ...props } = {}) {
14 return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />;
15}
16
17function DropdownMenuTrigger({ ...props } = {}) {
18 return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />;
19}
20
21function DropdownMenuContent({
22 align = "start",
23 alignOffset = 0,
24 side = "bottom",
25 sideOffset = 4,
26 className = "",
27 ...props
28}) {
29 return (
30 <MenuPrimitive.Portal>
31 <MenuPrimitive.Positioner
32 className="isolate z-50 outline-none"
33 align={align}
34 alignOffset={alignOffset}
35 side={side}
36 sideOffset={sideOffset}
37 >
38 <MenuPrimitive.Popup
39 data-slot="dropdown-menu-content"
40 className={cn(
41 "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-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 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden",
42 className,
43 )}
44 {...props}
45 />
46 </MenuPrimitive.Positioner>
47 </MenuPrimitive.Portal>
48 );
49}
50
51function DropdownMenuGroup({ ...props } = {}) {
52 return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />;
53}
54
55function DropdownMenuLabel({ className = "", inset = false, ...props }) {
56 return (
57 <MenuPrimitive.Group data-slot="dropdown-menu-group">
58 <MenuPrimitive.GroupLabel
59 data-slot="dropdown-menu-label"
60 data-inset={inset}
61 className={cn(
62 "text-muted-foreground px-2 py-1.5 text-xs data-[inset]:pl-8",
63 className,
64 )}
65 {...props}
66 />
67 </MenuPrimitive.Group>
68 );
69}
70
71function DropdownMenuItem({
72 className = "",
73 inset = false,
74 variant = "default",
75 ...props
76}) {
77 return (
78 <MenuPrimitive.Item
79 data-slot="dropdown-menu-item"
80 data-inset={inset}
81 data-variant={variant}
82 className={cn(
83// … truncated

What it pulls in

npm packages

  • @base-ui/react
  • lucide-react
  • clsx
  • tailwind-merge

Other registry items

  • https://optics.agusmayol.com.ar/r/utils.json

Files it writes

  • registry/optics/dropdown-menu.jsx

Facts

Registry
optics
Type
registry:component
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-04
Last confirmed
today

Go to the source

Docs on optics optics.agusmayol.com.ar AgusMayol/optics on GitHub Raw registry item This item as JSON

More from optics

All 79 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionopticsComponentsFree5 deps
AlertalertopticsComponentsFree4 deps
Alert Dialogalert-dialogopticsComponentsFree4 deps
Aspect Ratioaspect-ratioopticsComponentsFree2 deps
Auto Heightauto-heightopticsComponentsFree3 deps
AvataravataropticsComponentsFree3 deps
BadgebadgeopticsComponentsFree4 deps
BreadcrumbbreadcrumbopticsComponentsFree4 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex