The library is still in early development. Breaking changes and bugs may occur without prior notice. Thanks for your interest in using the library!

v0.2.49Beta

Search

Icon Button

Source

A square button for icon-only actions, supporting all color and size variants.

Usage

Import the IconButton component from @bun-ui/react and use it in your project:

import { IconButton } from "@bun-ui/react"
<IconButton>
  <StarIcon />
</IconButton>

Examples

Color

The IconButton supports all the same color variants as Button:

Sizes

The IconButton supports three square sizes: sm, md, and lg:

As Child

You can use the asChild prop to render the IconButton as a different element:

Props

IconButton

PropTypeDefaultDescription
asChild
booleanfalse

If true, the props of the button will be applied to the child element.

color
"primary" | "secondary" | "destructive" | "accent" | "neutral" | "success""neutral"

Color of the IconButton.

size
"xs" | "sm" | "md" | "lg""md"

Size of the IconButton.