v0.1.0
Get startedComponentsTheming
Install

Getting started

  • Introduction
  • Installation
  • Tailwind CSS
  • Next.js

Theming

  • Design tokens
  • Dark mode
  • Customization

Layout

  • SectionHeader
  • Container & Divider
  • AppShell
  • PageHeader

Actions

  • Button
  • IconButton

Forms

  • Input
  • Textarea
  • Select
  • Checkbox
  • Switch
  • SegmentedControl
  • RadioGroup
  • Combobox
  • DatePicker & DateRangePicker

Disclosure

  • Tabs
  • Accordion

Overlay

  • Modal
  • Drawer
  • Tooltip
  • Popover
  • DropdownMenu

Data display

  • Badge
  • Avatar
  • Card
  • StatCard
  • Table & DataTable
  • Pagination
  • Sparkline & chart colours

Feedback

  • Banner
  • Spinner
  • Skeleton
  • EmptyState
  • Toast
  • Progress

A lightweight, Tailwind-friendly React component library.

Getting started

  • Introduction
  • Installation
  • Tailwind CSS
  • Next.js

Theming

  • Design tokens
  • Dark mode
  • Customization

Components

  • SectionHeader
  • Container & Divider
  • AppShell
  • PageHeader
  • Button
  • IconButton
  • Input

Released under the MIT License.@kivu-ui/react on npm

Documentation

Getting started

  • Introduction
  • Installation
  • Tailwind CSS
  • Next.js

Theming

  • Design tokens
  • Dark mode
  • Customization

Layout

  • SectionHeader
  • Container & Divider
  • AppShell
  • PageHeader

Actions

  • Button
  • IconButton

Forms

  • Input
  • Textarea
  • Select
  • Checkbox
  • Switch
  • SegmentedControl
  • RadioGroup
  • Combobox
  • DatePicker & DateRangePicker

Disclosure

  • Tabs
  • Accordion

Overlay

  • Modal
  • Drawer
  • Tooltip
  • Popover
  • DropdownMenu

Data display

  • Badge
  • Avatar
  • Card
  • StatCard
  • Table & DataTable
  • Pagination
  • Sparkline & chart colours

Feedback

  • Banner
  • Spinner
  • Skeleton
  • EmptyState
  • Toast
  • Progress

DropdownMenu

A menu of actions for rows, the user menu and bulk actions, with full keyboard support.

import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuLabel, DropdownMenuSeparator } from "@kivu-ui/react"

On this page

UsageProps

Getting started

  • Introduction
  • Installation
  • Tailwind CSS
  • Next.js

Theming

  • Design tokens
  • Dark mode
  • Customization

Layout

  • SectionHeader
  • Container & Divider
  • AppShell
  • PageHeader

Actions

  • Button
  • IconButton

Forms

  • Input
  • Textarea
  • Select
  • Checkbox
  • Switch
  • SegmentedControl
  • RadioGroup
  • Combobox
  • DatePicker & DateRangePicker

Disclosure

  • Tabs
  • Accordion

Overlay

  • Modal
  • Drawer
  • Tooltip
  • Popover
  • DropdownMenu

Data display

  • Badge
  • Avatar
  • Card
  • StatCard
  • Table & DataTable
  • Pagination
  • Sparkline & chart colours

Feedback

  • Banner
  • Spinner
  • Skeleton
  • EmptyState
  • Toast
  • Progress

Usage

import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuLabel, DropdownMenuSeparator } from "@kivu-ui/react";

last action: nothing yet

import { useState } from "react";
import {
  DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel,
  DropdownMenuSeparator, DropdownMenuTrigger, IconButton,
} from "@kivu-ui/react";

const Dots = (
  <svg viewBox="0 0 16 16" fill="currentColor"><circle cx="3.5" cy="8" r="1.25" /><circle cx="8" cy="8" r="1.25" /><circle cx="12.5" cy="8" r="1.25" /></svg>
);

export default function Demo() {
  const [pinned, setPinned] = useState(true);
  const [last, setLast] = useState("nothing yet");
  return (
    <div className="flex flex-col items-center gap-3">
      <DropdownMenu>
        <DropdownMenuTrigger asChild>
          <IconButton aria-label="Row actions" variant="ghost" shape="square">{Dots}</IconButton>
        </DropdownMenuTrigger>
        <DropdownMenuContent align="end">
          <DropdownMenuLabel>Invoice #1042</DropdownMenuLabel>
          <DropdownMenuItem shortcut="⌘E" onSelect={() => setLast("Edit")}>Edit</DropdownMenuItem>
          <DropdownMenuItem shortcut="⌘D" onSelect={() => setLast("Duplicate")}>Duplicate</DropdownMenuItem>
          <DropdownMenuCheckboxItem checked={pinned} onCheckedChange={setPinned}>Pinned</DropdownMenuCheckboxItem>
          <DropdownMenuSeparator />
          <DropdownMenuItem tone="danger" onSelect={() => setLast("Delete")}>Delete</DropdownMenuItem>
        </DropdownMenuContent>
      </DropdownMenu>
      <p className="font-mono text-xs text-fg-muted">last action: {last}</p>
    </div>
  );
}

Props

DropdownMenu

PropTypeDefaultDescription
openboolean-Open state (controlled).
defaultOpenbooleanfalseInitial open state (uncontrolled).
onOpenChange(open: boolean) => void-Called when it opens or closes.

DropdownMenuContent

Extends <div> attributes.

PropTypeDefaultDescription
side"top" | "bottom" | "left" | "right""bottom"Preferred side; flips when there isn't room.
align"start" | "center" | "end""start"Alignment along the trigger.
offsetnumber6Gap from the trigger, in px.

DropdownMenuItem

PropTypeDefaultDescription
onSelect(event: Event) => void-Called when chosen. Call event.preventDefault() to keep the menu open.
iconReactNode-Icon on the left.
shortcutReactNode-Shortcut hint on the right, e.g. ⌘D.
tone"default" | "danger""default"Danger for destructive actions.
disabledbooleanfalseSkip this item.
asChildbooleanfalseRender the single child (e.g. a router Link) with this item's styles and behaviour.

DropdownMenuCheckboxItem

PropTypeDefaultDescription
checkedboolean-Required. Whether it's ticked.
onCheckedChange(checked: boolean) => void-Called when toggled. The menu stays open.

Every component also accepts className and forwards its ref. Root CSS class: .kivu-menu

PreviousPopoverNextBadge