IconButton
Icon-only button with accessible label. Same variants as Button but square aspect ratio.
Examples
Primary
Square icon button with primary styling.
Secondary
Square icon button with secondary (outlined) styling.
Ghost
Square icon button with ghost (no border) styling.
Destructive
Square icon button signalling a destructive action.
Installation
pnpm add @rokle/components @rokle/tokensInstalls with the default Rokle brand. Generate a custom brand on rokle.app to use your own colours and personality.
Usage
import { IconButton } from "@rokle/components";import { IconButton } from "@rokle/components";
export function Example() {
return <IconButton />;
}API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| icon | ReactNode | - | Icon element to display. |
| label | string | - | Accessible label for screen readers. |
| variant | "primary" | "secondary" | "ghost" | "destructive" | "ghost" | Visual style variant. |
| size | "sm" | "md" | "lg" | "md" | Button size. |