MicroClub Dropdown Menu
mcoli-ui-registry/mc-dropdown-menuFreeComponent
A dropdown menu component for MicroClub UI
Live preview
live · rendered by the registry
Rendered by mcoli-ui-registry on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://mcoli-ui.microclub.info/r/mc-dropdown-menu.jsonSource
1'use client';23import * as React from 'react';4import { Menu as MenuPrimitive } from '@base-ui/react/menu';5import { CheckIcon, ChevronRightIcon } from 'lucide-react';67import { cn } from '@/lib/utils';89function McDropdownMenu({ ...props }: MenuPrimitive.Root.Props) {10 return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />;11}1213function McDropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {14 return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />;15}1617function McDropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {18 return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />;19}2021function McDropdownMenuContent({22 align = 'start',23 alignOffset = 0,24 side = 'bottom',25 sideOffset = 4,26 className,27 ...props28}: MenuPrimitive.Popup.Props &29 Pick<MenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>) {30 return (31 <MenuPrimitive.Portal>32 <MenuPrimitive.Positioner33 className="isolate z-50 outline-none"34 align={align}35 alignOffset={alignOffset}36 side={side}37 sideOffset={sideOffset}38 >39 <MenuPrimitive.Popup40 data-slot="dropdown-menu-content"41 className={cn(42 'z-50 w-56 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground opacity-100 shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95',43 className44 )}45 {...props}46 />47 </MenuPrimitive.Positioner>48 </MenuPrimitive.Portal>49 );50}5152function McDropdownMenuGroup({53 className,54 ...props55}: MenuPrimitive.Group.Props & { className?: string }) {56 return (57 <MenuPrimitive.Group58 data-slot="dropdown-menu-group"59 className={cn('w-56 h-[100px] opacity-100 pt-1 px-1', className)}60 {...props}61 />62 );63}6465function McDropdownMenuLabel({66 className,67 inset,68 ...props69}: MenuPrimitive.GroupLabel.Props & {70 inset?: boolean;71}) {72 return (73 <MenuPrimitive.GroupLabel74// … truncated
What it pulls in
npm packages
Files it writes
More from mcoli-ui-registry
All 42 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| MicroClub Accordionmc-accordion | mcoli-ui-registry | Components | Free | 2 deps | |
| MicroClub Alertmc-alert | mcoli-ui-registry | Components | Free | 1 dep | |
| MicroClub Alert Dialogmc-alert-dialog | mcoli-ui-registry | Components | Free | 1 dep | |
| MicroClub Avatarmc-avatar | mcoli-ui-registry | Components | Free | 1 dep | |
| MicroClub Badgemc-badge | mcoli-ui-registry | Components | Free | 1 dep | |
| MicroClub Breadcrumbmc-breadcrumb | mcoli-ui-registry | Components | Free | 2 deps | |
| MicroClub Buttonmc-button | mcoli-ui-registry | Components | Free | 2 deps | |
| MicroClub Calendarmc-calendar | mcoli-ui-registry | Components | Free | 3 deps |
