A square or round button that holds just an icon. Requires an aria-label.
import { IconButton } from "@kivu-ui/react"On this page
import { IconButton } from "@kivu-ui/react";import { IconButton } from "@kivu-ui/react";
const Arrow = () => (
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
<path d="M5 12h14M13 6l6 6-6 6" />
</svg>
);
export default function Demo() {
return (
<div className="flex flex-wrap items-center gap-3">
<IconButton aria-label="Next" size="sm"><Arrow /></IconButton>
<IconButton aria-label="Next"><Arrow /></IconButton>
<IconButton aria-label="Next" size="lg"><Arrow /></IconButton>
<IconButton aria-label="Next" variant="soft"><Arrow /></IconButton>
<IconButton aria-label="Next" variant="outline" shape="square"><Arrow /></IconButton>
<IconButton aria-label="Next" variant="white"><Arrow /></IconButton>
</div>
);
}Extends all <button> attributes.
| Prop | Type | Default | Description |
|---|---|---|---|
aria-label | string | - | Required. The accessible name of the button. |
variant | "solid" | "soft" | "outline" | "ghost" | "glass" | "white" | "solid" | Visual style. |
tone | "primary" | "accent" | "danger" | "primary" | Colour family. |
size | "sm" | "md" | "lg" | "md" | Controls the size. |
shape | "circle" | "square" | "circle" | Fully round or rounded square. |
className | string | - | Extra classes; Tailwind utilities override the component's styles. |
Every component also accepts className and forwards its ref. Root CSS class: .kivu-icon-btn