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

Button

Triggers an action. Comes in six variants and three tones, and can render as a link.

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

On this page

UsageVariantsSizesTonesOn brand backgroundsLoading, disabled & sectionsAs a linkTailwind overridesProps

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

export default function Demo() {
  return <Button>Create project</Button>;
}

Examples

Variants

Use the variant prop to change the visual style.

import { Button } from "@kivu-ui/react";

export default function Demo() {
  return (
    <div className="flex flex-wrap items-center gap-3">
      <Button variant="solid">Solid</Button>
      <Button variant="soft">Soft</Button>
      <Button variant="outline">Outline</Button>
      <Button variant="ghost">Ghost</Button>
      <Button variant="link">Link</Button>
    </div>
  );
}

Sizes

sm is 36px, md is 48px and lg is 56px tall.

import { Button } from "@kivu-ui/react";

export default function Demo() {
  return (
    <div className="flex flex-wrap items-center gap-3">
      <Button size="sm">Small</Button>
      <Button size="md">Medium</Button>
      <Button size="lg">Large</Button>
    </div>
  );
}

Tones

Use tone to switch the colour family. Works with every variant.

import { Button } from "@kivu-ui/react";

export default function Demo() {
  return (
    <div className="flex flex-wrap items-center gap-3">
      <Button tone="primary">Primary</Button>
      <Button tone="accent">Accent</Button>
      <Button tone="danger">Delete project</Button>
      <Button tone="danger" variant="soft">Soft danger</Button>
    </div>
  );
}

On brand backgrounds

The glass variant is a frosted button for images and brand colours.

import { Button } from "@kivu-ui/react";

export default function Demo() {
  return (
    <div className="flex w-full flex-wrap gap-3 rounded-kivu-xl bg-gradient-to-br from-primary-700 to-primary-500 p-8">
      <Button variant="soft" size="lg">Start free trial</Button>
      <Button variant="glass" size="lg">Watch the demo</Button>
    </div>
  );
}

Loading, disabled & sections

loading shows a spinner and disables the button. leftSection and rightSection hold icons.

import { Button } from "@kivu-ui/react";

export default function Demo() {
  return (
    <div className="flex flex-wrap items-center gap-3">
      <Button loading>Publishing</Button>
      <Button disabled>Disabled</Button>
      <Button rightSection={<span aria-hidden>→</span>}>Continue</Button>
    </div>
  );
}

As a link

Use asChild to style any element, such as Next.js Link.

I am an anchor
import { Button } from "@kivu-ui/react";

// Works with any element or router link, e.g. Next.js <Link>.
export default function Demo() {
  return (
    <Button asChild variant="outline">
      <a href="#as-link">I am an anchor</a>
    </Button>
  );
}

Tailwind overrides

Pass utilities in className. They always win over component styles.

import { Button } from "@kivu-ui/react";

// Utilities win over component styles. No tailwind-merge needed.
export default function Demo() {
  return (
    <div className="flex flex-wrap gap-3">
      <Button className="rounded-full px-10">Rounded</Button>
      <Button className="bg-emerald-600 hover:bg-emerald-700">Emerald</Button>
      <Button variant="outline" className="border-2 border-dashed">Dashed</Button>
    </div>
  );
}

Props

Button

Extends all <button> attributes. type defaults to "button".

PropTypeDefaultDescription
variant"solid" | "soft" | "outline" | "ghost" | "glass" | "link""solid"Visual style.
tone"primary" | "accent" | "danger""primary"Colour family.
size"sm" | "md" | "lg""md"Controls the size.
loadingbooleanfalseShows a spinner, sets aria-busy and disables the button.
fullWidthbooleanfalseStretch to the parent's width.
leftSectionReactNode-Content before the label (usually an icon).
rightSectionReactNode-Content after the label.
asChildbooleanfalseRender the single child (e.g. a router Link) with this button's styles and behaviour.
classNamestring-Extra classes; Tailwind utilities override the component's styles.

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

PreviousPageHeaderNextIconButton