Skip to content

DropdownMenu

A trigger + floating menu. Flat items render as a single list; an item with children opens a flyout submenu. The FloatingTree lets every level cooperate on focus and dismissal, so selecting any leaf closes the whole menu.

Source

import { DropdownMenu } from "@flanksource/clicky-ui/components";
Items · Open in Storybook
Align Left · Open in Storybook
Custom Trigger · Open in Storybook

The props table documents the component-specific surface. Standard DOM attributes inherited from React, such as className, event handlers, and accessibility attributes, may also be accepted when the component’s prop type extends a native element.

Prop Type Default Description
align enum — Horizontal alignment of the menu relative to the trigger.
children (…) => ReactNode — Custom menu content. Use `closeMenu` to dismiss after a selection.
className string — Classes applied to the wrapper.
footer ReactNode — Rendered at the bottom of the menu, below the items/children (e.g. a "Show more…" link).
header ReactNode — Rendered at the top of the menu, above the items/children.
hideChevron boolean — Hide the trailing chevron on the default trigger.
icon string | ComponentClass<any, any> | FunctionComponent<any> — Icon shown before the trigger label. Ignored when `trigger` is provided.
items DropdownMenuItem[] — Declarative menu items. Provide this or `children`, not both.
label ReactNode — Trigger label. Ignored when `trigger` is provided.
menuClassName string — Classes applied to the floating menu.
menuLabel string — Accessible label (`aria-label`) for the floating menu element itself.
onOpenChange (…) => void — Notified whenever the menu opens or closes.
role enum — —
size "sm" | "lg" | "default" | "icon" | null — Size forwarded to the default Button trigger.
title string — Browser tooltip / accessible label for the default trigger.
trigger ReactNode — Custom trigger element. Its root receives menu state and interaction props.
variant "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null — Variant forwarded to the default Button trigger.