IOS Drop Down

An iOS-style dropdown menu with spring-physics animation, nested submenus, dark and light themes, an optional page backdrop, and full keyboard navigation.

Open a menu — submenus, icons, checkmarks, and backdrops are live

Installation

  1. 1

    Install the component:

    npx shadcn@latest add https://ui.amines.fun/registry/ios-drop-down.json
  2. 2

    Usage:

    jsx

    app/page.jsx

    import DropMenu from "@/registry/blocks/IOSDropMenu";const items = [  { id: "profile", label: "View Profile" },  {    id: "share",    label: "Share",    children: [      { id: "copy-link", label: "Copy Link" },      { id: "message", label: "Send Message" },    ],  },  { id: "download", label: "Download", keepOpen: true },  { id: "delete", label: "Delete", destructive: true },];export default function Page() {  return (    <DropMenu      items={items}      label="Account"      theme="dark"      backdrop="blur"      onSelect={(item) => console.log(item.label)}    />  );}

Props

PropTypeDefaultDescriptionRequired
itemsArray<DropMenuItem>[]Menu rows to render. Each item supports id (defaults to label), label (ReactNode), icon (ReactNode), disabled, destructive (red styling), keepOpen (overrides closeOnSelect), onSelect ((item) => void), className, and children (DropMenuItem[] that opens a nested submenu on the main layer). A flat array or a one-level nested array of groups is accepted.No
triggerReactNode | (({ open }: { open: boolean }) => ReactNode)label text plus an animated chevronCustom trigger content. Pass a function to receive the open state, or any ReactNode to fully replace the default trigger.No
labelReactNode"Menu"Label shown in the default trigger and used as the accessible menu name when it is a string.No
theme"dark" | "light""dark"Color theme for the trigger, menu panel, highlights, and backdrop. Unknown values fall back to dark.No
side"auto" | "top" | "bottom""auto"Which side of the trigger the menu opens on. auto flips to top when there is not enough room below.No
align"start" | "center" | "end""start"Horizontal alignment of the menu panel relative to the trigger.No
sideOffsetnumber10Gap between the trigger and the menu panel, in pixels.No
widthnumber260Menu panel width in pixels. Capped by max-width: calc(100vw - 1rem) so it never overflows the viewport.No
backdrop"none" | "blur" | "dim""none"Optional fixed page backdrop shown while the menu is open: none, a blurred overlay, or a dimmed overlay. Clicking it closes the menu.No
iconPosition"start" | "end""end"Where item icons and selection checkmarks are rendered inside each row.No
closeOnSelectbooleantrueClose the menu after a selectable item is activated. An item's keepOpen flag overrides this per row.No
closeDelaynumber220Delay in milliseconds before the menu closes after selection, so the checkmark animation is visible.No
openbooleanundefined (uncontrolled)Controlled open state. When provided, the component no longer manages its own state; pair with onOpenChange.No
defaultOpenbooleanfalseInitial open state when the component is uncontrolled.No
onOpenChange(open: boolean) => void-Called whenever the menu requests an open-state change, for both controlled and uncontrolled usage.No
onSelect(item: DropMenuItem) => void-Called with the activated item after its own onSelect handler, before the menu closes.No
disabledbooleanfalseDisable the trigger button so the menu cannot be opened.No
ariaLabelstringlabel when it is a string, otherwise "Menu"Accessible name for the menu panel.No
classNamestringundefinedAdditional class name applied to the root wrapper element.No
classNamesPartial<Record<"root" | "trigger" | "backdrop" | "panel" | "group" | "item" | "highlight" | "icon" | "label", string>>{}Optional class names for the root, trigger button, backdrop, panel, menu group, row, hover highlight, icon slot, and label elements.No