Icon button
A square button that holds one pixel icon: every toolbar.
import { IconButton } from "@forgeron/ui";import { Archive01Icon, Delete02Icon, Mail01Icon, MoreHorizontalIcon } from "@forgeron/icons";
import { IconButton } from "@forgeron/ui";
export default function Toolbar() {
return (
<>
<IconButton icon={Mail01Icon} label="Reply by email" />
<IconButton icon={Archive01Icon} label="Archive" />
<IconButton icon={Delete02Icon} label="Delete" />
<IconButton icon={MoreHorizontalIcon} label="More actions" variant="boxed" />
</>
);
}import { Add01Icon } from "@forgeron/icons";
import { IconButton } from "@forgeron/ui";
export default function Sizes() {
return (
<>
<IconButton icon={Add01Icon} label="New issue" size="sm" variant="boxed" />
<IconButton icon={Add01Icon} label="New issue" variant="boxed" />
<IconButton icon={Add01Icon} label="New issue" disabled />
</>
);
}API → Props
| Prop | Type | Default | Description |
|---|---|---|---|
icon | IconDefinition | — | The pixel icon. |
label | string | — | Its name: an icon alone has none. |
variant | "ghost" | "boxed" | "ghost" | Framed on hover, or always. |
size | "sm" | "md" | "md" | 24 or 32 px. |
href | string | — | Renders an anchor. |
className | string | — | Extra classes. |