Skip to content
العربية
Overlays

DropdownMenu

A menu of actions from a button. Items: label, icon, shortcut, danger, separators and headings.

import { DropdownMenu } from "@percentsa/ui";

Examples

Code
export function DropdownMenuExample() {
  const t = useT();
  return (
    <DropdownMenu
      trigger={<Button variant="secondary">{t("Actions", "الإجراءات")}</Button>}
      items={[
        { heading: t("Project", "المشروع") },
        { label: t("Rename", "إعادة تسمية"), icon: <Pencil aria-hidden />, shortcut: "R" },
        { label: t("Duplicate", "نسخ"), icon: <Copy aria-hidden />, shortcut: "⌘D" },
        "separator",
        { label: t("Delete", "حذف"), icon: <Trash2 aria-hidden />, danger: true },
      ]}
    />
  );
}