Primitives

Dropdown menu and Popover

Rich items (icon tile, description, shortcut, badge), account header, dark menu; popovers with arrow, dark and brand.

Import#

Everything comes from the package root. The example above uses:

your-component.tsx
import {
  Avatar,
  Badge,
  Button,
  DropdownMenu,
  DropdownMenuContent,
  DropdownMenuHeader,
  DropdownMenuItem,
  DropdownMenuLabel,
  DropdownMenuSeparator,
  DropdownMenuSub,
  DropdownMenuSubContent,
  DropdownMenuSubTrigger,
  DropdownMenuTrigger,
  Popover,
  PopoverContent,
  PopoverHeader,
  PopoverTrigger,
} from "@waveinno/ui";

Props#

Read from the source of this version, so they match the code exactly.

<Avatar>

src/components/ui/avatar.tsx
PropTypeDefaultDescription
namerequiredstring—
srcstring | null—
sizekeyof typeof sizes"md"
statuskeyof typeof STATUS—
verifiedboolean—
ring"gradient"—
shape"circle" | "square""circle"
classNamestring—

<Badge>

src/components/ui/badge.tsx
PropTypeDefaultDescription
dotbooleantrue
variant"soft" | "solid" | "outline" | "dot" | "gradient" | "live""soft"

Also takes HTMLAttributes<HTMLSpanElement> & VariantProps<typeof badgeVariants>.

<Button>

src/components/ui/button.tsx
PropTypeDefaultDescription
asChildbooleanfalse
loadingboolean—

Also takes ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants>.

<DropdownMenuContent>

src/components/ui/dropdown-menu.tsx
PropTypeDefaultDescription
variant"default" | "glass" | "dark""default"

Also takes ComponentPropsWithoutRef<typeof Primitive.Content>.

<DropdownMenuHeader>

src/components/ui/dropdown-menu.tsx
PropTypeDefaultDescription
titlerequiredReact.ReactNode—
subtitleReact.ReactNode—
mediaReact.ReactNode—An Avatar or mark.
classNamestring—

<DropdownMenuItem>

src/components/ui/dropdown-menu.tsx
PropTypeDefaultDescription
dangerboolean—
iconReact.ReactNode—Icon in a soft tile on the left.
descriptionReact.ReactNode—Second line, muted: what the item does.
shortcutstring—
badgeReact.ReactNode—

Also takes ComponentPropsWithoutRef<typeof Primitive.Item>.

<DropdownMenuLabel>

src/components/ui/dropdown-menu.tsx

Also takes ComponentPropsWithoutRef<typeof Primitive.Label> (passed through).

<DropdownMenuSeparator>

src/components/ui/dropdown-menu.tsx

Also takes ComponentPropsWithoutRef<typeof Primitive.Separator> (passed through).

<DropdownMenuSubContent>

src/components/ui/dropdown-menu.tsx

Also takes ComponentPropsWithoutRef<typeof Primitive.SubContent> (passed through).

<DropdownMenuSubTrigger>

src/components/ui/dropdown-menu.tsx

Also takes ComponentPropsWithoutRef<typeof Primitive.SubTrigger> (passed through).

<PopoverContent>

src/components/ui/popover.tsx
PropTypeDefaultDescription
variant"default" | "glass" | "dark" | "brand""default"
arrowbooleanfalse

Also takes ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>.

<PopoverHeader>

src/components/ui/popover.tsx
PropTypeDefaultDescription
titlerequiredReact.ReactNode—
descriptionReact.ReactNode—
iconReact.ReactNode—
classNamestring—

Install#

If the project does not have the package yet, add it, then follow the setup for Next.js or Vite once.

$ npm install @waveinno/ui