AsterUIDocsv1.0.2

Docs / Component reference

Popover & DropdownMenu

Open a small set of choices next to its trigger, then dismiss it without leaving the current task.

Popover example

Install

sh
npx @fierst/ui@1.0.2 add popover

Registry dependencies: theme, button, icon. Package dependencies: @lucide/icons.

Exports from ./ui/popover: Popover, MenuItem, DropdownMenu.

Download the registry source for popover 1.0.2.

API contracts

ts
export function Popover({
  id,
  mode = 'auto',
  align = 'start',
  onToggle,
  class: extraClass,
  children,
}: {
  id: string;
  mode?: 'auto' | 'manual';
  align?: 'start' | 'end';
  onToggle?: (e: any) => void;
  class?: string;
  children?: View;
})

export interface MenuItem {
  id: string;
  label: string;
  shortcut?: string;
  danger?: boolean;
  separatorBefore?: boolean;
  onSelect: () => void;
}

export function DropdownMenu({
  label,
  variant = 'outline',
  align = 'start',
  items,
}: {
  label: string;
  variant?: ButtonVariant;
  align?: 'start' | 'end';
  items: readonly MenuItem[];
})