@heroui/dropdown
Version:
A dropdown displays a list of actions or options that a user can choose.
28 lines (25 loc) • 741 B
JavaScript
"use client";
import {
DropdownProvider
} from "./chunk-BV7BCS3N.mjs";
import {
useDropdown
} from "./chunk-RLCA5XPT.mjs";
// src/dropdown.tsx
import React from "react";
import { Popover } from "@heroui/popover";
import { jsx, jsxs } from "react/jsx-runtime";
var Dropdown = (props) => {
const { children, ...otherProps } = props;
const context = useDropdown(otherProps);
const [menuTrigger, menu] = React.Children.toArray(children);
return /* @__PURE__ */ jsx(DropdownProvider, { value: context, children: /* @__PURE__ */ jsxs(Popover, { ...context.getPopoverProps(), children: [
menuTrigger,
menu
] }) });
};
Dropdown.displayName = "HeroUI.Dropdown";
var dropdown_default = Dropdown;
export {
dropdown_default
};