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

Modal

A dialog built on native <dialog>, with focus trap, Escape and top-layer rendering built in.

import { Modal } from "@kivu-ui/react"

On this page

UsageWith a formProps

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 { Modal } from "@kivu-ui/react";

Archive “Brand refresh”?

Members lose edit access. You can restore it any time.

Open tasks stay as they are. Press Escape or click outside to close.
import { useState } from "react";
import { Button, Modal } from "@kivu-ui/react";

export default function Demo() {
  const [open, setOpen] = useState(false);
  return (
    <>
      <Button tone="danger" variant="soft" onClick={() => setOpen(true)}>Archive project</Button>
      <Modal
        open={open}
        onClose={() => setOpen(false)}
        title="Archive “Brand refresh”?"
        description="Members lose edit access. You can restore it any time."
        footer={
          <>
            <Button variant="ghost" onClick={() => setOpen(false)}>Cancel</Button>
            <Button tone="danger" onClick={() => setOpen(false)}>Archive</Button>
          </>
        }
      >
        Open tasks stay as they are. Press Escape or click outside to close.
      </Modal>
    </>
  );
}

Examples

With a form

Send feedback

import { useState } from "react";
import { Button, Input, Modal, Textarea } from "@kivu-ui/react";

export default function Demo() {
  const [open, setOpen] = useState(false);
  return (
    <>
      <Button variant="soft" onClick={() => setOpen(true)}>Send feedback</Button>
      <Modal open={open} onClose={() => setOpen(false)} title="Send feedback" size="sm">
        <form
          className="space-y-4"
          onSubmit={(e) => {
            e.preventDefault();
            setOpen(false);
          }}
        >
          <Input label="Email" type="email" required />
          <Textarea label="What could be better?" rows={3} />
          <Button type="submit" fullWidth>Send</Button>
        </form>
      </Modal>
    </>
  );
}

Props

Modal

Extends <dialog> attributes.

PropTypeDefaultDescription
openboolean-Required. Whether the modal is shown.
onClose() => void-Required. Called on Escape, backdrop click or the × button.
titleReactNode-Heading; becomes the dialog's accessible name.
descriptionReactNode-Supporting text under the title.
footerReactNode-Right-aligned actions.
size"sm" | "md" | "lg""md"Controls the size.
closeOnBackdropbooleantrueClose when clicking outside the panel.
hideCloseButtonbooleanfalseHide the × button.

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

PreviousAccordionNextDrawer