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 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

Combobox

A searchable select, for one value or several. Shares the field styles of Input and Select.

import { Combobox } from "kivu-ui"

On this page

UsageMultipleProps

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 { Combobox } from "kivu-ui";

value: Rwanda

import { useState } from "react";
import { Combobox } from "kivu-ui";

const countries = ["Burundi", "DR Congo", "Kenya", "Rwanda", "Tanzania", "Uganda"];

export default function Demo() {
  const [country, setCountry] = useState<string | null>("Rwanda");
  return (
    <div className="grid w-full max-w-xs gap-3">
      <Combobox label="Country" labelPosition="outside" options={countries} value={country} onValueChange={setCountry} clearable />
      <p className="font-mono text-xs text-fg-muted">value: {String(country)}</p>
    </div>
  );
}

Examples

Multiple

Options can have a description or be disabled.

import { Combobox } from "kivu-ui";

const tags = [
  { value: "design", label: "Design" },
  { value: "eng", label: "Engineering" },
  { value: "growth", label: "Growth", description: "Marketing and sales" },
  { value: "ops", label: "Operations" },
  { value: "legal", label: "Legal", disabled: true },
];

export default function Demo() {
  return (
    <div className="w-full max-w-xs">
      <Combobox multiple label="Teams" labelPosition="outside" placeholder="All teams" options={tags} defaultValue={["design", "eng"]} maxDisplayed={2} />
    </div>
  );
}

Props

Combobox

PropTypeDefaultDescription
options(string | { value, label, description?, icon?, disabled? })[]-Required. The choices.
multiplebooleanfalseAllow several values (value becomes string[]).
value / defaultValuestring | null | string[]-Selected value(s).
onValueChange(value) => void-Called when the selection changes.
maxDisplayednumber-Multiple: labels listed before “+N”.
searchablebooleantrueShow the search box.
searchPlaceholderstring-Placeholder for the search box.
emptyTextReactNode-Shown when nothing matches.
filter(option, query) => boolean-Custom matching.
manualFilter / onSearchChangeboolean / (query) => void-Search on the server instead.
loadingbooleanfalseShow a loading row.
clearablebooleanfalseShow a × button that clears the value.
placeholderReactNode-Shown when nothing is selected.
disabledbooleanfalseDisable the field.
namestring-Adds hidden input(s) so the value posts with a native form.
open / onOpenChangeboolean / (open) => void-Control the panel.
panelClassNamestring-Class for the floating panel.
labelReactNode-Field label, wired to the control with htmlFor.
labelPosition"inside" | "outside""inside"Small label inside the box, or a regular label above it.
descriptionReactNode-Helper text; linked via aria-describedby.
errorReactNode | boolean-Error message (or true for just a red border). Sets aria-invalid.
wrapperClassNamestring-Class for the outer wrapper. className goes to the control itself.

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

PreviousRadioGroupNextDatePicker & DateRangePicker