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

Input

Text input with a built-in label, helper text, validation and side sections.

import { Input } from "kivu-ui"

On this page

UsageLabel positionLeft & right sectionsDescription & errorVariantsProps

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

export default function Demo() {
  return <Input label="Project name" placeholder="Brand refresh" className="w-full" wrapperClassName="w-full max-w-sm" />;
}

Examples

Label position

By default the label sits inside the box. Set labelPosition="outside" for a classic label.

import { Input } from "kivu-ui";

export default function Demo() {
  return (
    <div className="grid w-full max-w-xl gap-4 sm:grid-cols-2">
      <Input label="Inside (default)" placeholder="you@example.com" />
      <Input label="Outside" labelPosition="outside" placeholder="you@example.com" />
    </div>
  );
}

Left & right sections

Add prefixes, units or icons.

field.app/
USD/h
import { Input } from "kivu-ui";

export default function Demo() {
  return (
    <div className="grid w-full max-w-xl gap-4 sm:grid-cols-2">
      <Input label="Workspace URL" leftSection="field.app/" defaultValue="studio" />
      <Input label="Hourly rate" rightSection="USD/h" inputMode="decimal" defaultValue="85" />
    </div>
  );
}

Description & error

Both are connected to the input with aria-describedby.

We'll send the invite here.

Project name is required

import { Input } from "kivu-ui";

export default function Demo() {
  return (
    <div className="grid w-full max-w-xl gap-4 sm:grid-cols-2">
      <Input label="Email" description="We'll send the invite here." />
      <Input label="Project name" error="Project name is required" />
    </div>
  );
}

Variants

import { Input } from "kivu-ui";

export default function Demo() {
  return (
    <div className="grid w-full gap-4 sm:grid-cols-3">
      <Input label="Default" />
      <Input label="Filled" variant="filled" />
      <div className="rounded-kivu-lg bg-primary-600 p-3">
        <Input label="Glass" variant="glass" />
      </div>
    </div>
  );
}

Props

Input

Extends all <input> attributes except size.

PropTypeDefaultDescription
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.
variant"default" | "filled" | "glass""default"Visual style. Glass is for brand or image backgrounds.
wrapperClassNamestring-Class for the outer wrapper. className goes to the control itself.
leftSectionReactNode-Content before the value: an icon, prefix or URL stem.
rightSectionReactNode-Content after the value: a unit or icon.
size"sm" | "md" | "lg""md"Controls the size.
classNamestring-Extra classes; Tailwind utilities override the component's styles.

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

PreviousIconButtonNextTextarea