Triggers an action. Comes in six variants and three tones, and can render as a link.
import { Button } from "kivu-ui"On this page
import { Button } from "kivu-ui";import { Button } from "kivu-ui";
export default function Demo() {
return <Button>Create project</Button>;
}Use the variant prop to change the visual style.
import { Button } from "kivu-ui";
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>
);
}sm is 36px, md is 48px and lg is 56px tall.
import { Button } from "kivu-ui";
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>
);
}Use tone to switch the colour family. Works with every variant.
import { Button } from "kivu-ui";
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>
);
}The glass variant is a frosted button for images and brand colours.
import { Button } from "kivu-ui";
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 shows a spinner and disables the button. leftSection and rightSection hold icons.
import { Button } from "kivu-ui";
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>
);
}Use asChild to style any element, such as Next.js Link.
import { Button } from "kivu-ui";
// 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>
);
}Pass utilities in className. They always win over component styles.
import { Button } from "kivu-ui";
// 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>
);
}Extends all <button> attributes. type defaults to "button".
| Prop | Type | Default | Description |
|---|---|---|---|
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. |
loading | boolean | false | Shows a spinner, sets aria-busy and disables the button. |
fullWidth | boolean | false | Stretch to the parent's width. |
leftSection | ReactNode | - | Content before the label (usually an icon). |
rightSection | ReactNode | - | Content after the label. |
asChild | boolean | false | Render the single child (e.g. a router Link) with this button's styles and behaviour. |
className | string | - | Extra classes; Tailwind utilities override the component's styles. |
Every component also accepts className and forwards its ref. Root CSS class: .kivu-btn