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

AppShell

The dashboard frame: a collapsible sidebar, a top bar and scrolling content. Below 1024px the sidebar becomes a drawer.

import { AppShell, Sidebar, SidebarHeader, SidebarContent, SidebarGroup, SidebarItem, SidebarFooter, Topbar, SidebarTrigger } 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 { AppShell, Sidebar, SidebarHeader, SidebarContent, SidebarGroup, SidebarItem, SidebarFooter, Topbar, SidebarTrigger } from "@kivu-ui/react";
Nyota
  • Overview
  • Reports
  • Inbox12

Workspace

  • Team
AUAmara Uwase
Overview

Revenue

$48,120

Up +12.5%vs last month

Churn

2.1%

Down −0.4%vs last month

import {
  AppShell, Avatar, Badge, IconTile, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarHeader,
  SidebarItem, SidebarTrigger, StatCard, Topbar,
} from "@kivu-ui/react";

const icon = (d: string) => (
  <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"><path d={d} /></svg>
);
const HomeIcon = icon("M2.5 7 8 2.5 13.5 7v6.5h-11z");
const ChartIcon = icon("M2.5 13.5h11M4.5 11V7M8 11V4M11.5 11V8.5");
const InboxIcon = icon("M2.5 9.5h3l1 2h3l1-2h3M2.5 9.5 4.5 3.5h7l2 6v3.5h-11z");
const UsersIcon = icon("M6 7.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM1.5 13.5c0-2.5 2-4 4.5-4s4.5 1.5 4.5 4M11 3a2.2 2.2 0 0 1 0 4.4M12.5 9.7c1.3.5 2 1.8 2 3.8");

export default function Demo() {
  return (
    <div className="w-full overflow-hidden rounded-kivu-xl border border-line">
      <AppShell
        className="h-[460px] min-h-0"
        sidebar={
          <Sidebar>
            <SidebarHeader>
              <IconTile size="sm" variant="solid">{ChartIcon}</IconTile>
              <span className="font-display font-semibold">Nyota</span>
            </SidebarHeader>
            <SidebarContent>
              <SidebarGroup>
                <SidebarItem href="#app-shell" icon={HomeIcon} active>Overview</SidebarItem>
                <SidebarItem href="#app-shell" icon={ChartIcon}>Reports</SidebarItem>
                <SidebarItem href="#app-shell" icon={InboxIcon} badge={<Badge size="sm">12</Badge>}>Inbox</SidebarItem>
              </SidebarGroup>
              <SidebarGroup label="Workspace">
                <SidebarItem href="#app-shell" icon={UsersIcon}>Team</SidebarItem>
              </SidebarGroup>
            </SidebarContent>
            <SidebarFooter>
              <Avatar name="Amara Uwase" size="sm" />
              <span className="text-sm">Amara Uwase</span>
            </SidebarFooter>
          </Sidebar>
        }
        header={
          <Topbar>
            <SidebarTrigger />
            <span className="font-semibold">Overview</span>
          </Topbar>
        }
      >
        <div className="grid gap-4 sm:grid-cols-2">
          <StatCard label="Revenue" value="$48,120" delta={12.5} deltaLabel="vs last month" />
          <StatCard label="Churn" value="2.1%" delta={-0.4} invertTrend deltaLabel="vs last month" />
        </div>
      </AppShell>
    </div>
  );
}

Props

AppShell

Extends <div> attributes.

PropTypeDefaultDescription
sidebarReactNode-Usually a <Sidebar>.
headerReactNode-Usually a <Topbar>. Sticks to the top of the main column.
sidebarCollapsedboolean-Collapsed state (controlled).
defaultSidebarCollapsedbooleanfalseInitial collapsed state.
onSidebarCollapsedChange(collapsed: boolean) => void-Called when the sidebar collapses or expands.
padding"none" | "sm" | "md" | "lg""md"Padding around the page content.
mainClassNamestring-Class for the <main> element.

SidebarItem

Extends <a> attributes.

PropTypeDefaultDescription
iconReactNode-Icon on the left; the only thing shown when collapsed.
badgeReactNode-Count or status on the right.
activebooleanfalseMarks the current page (aria-current).
asChildbooleanfalseRender the single child (e.g. a router Link) with this item's styles and behaviour.

SidebarGroup

PropTypeDefaultDescription
labelReactNode-Small heading above the group. Hidden when collapsed.

useAppShell()

PropTypeDefaultDescription
returns{ collapsed, setCollapsed, mobileOpen, setMobileOpen, toggleSidebar }-Shell state, for building your own trigger.

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

PreviousContainer & DividerNextPageHeader