Skip to content
Browse library
BIU UI/Components/Icon Button
COMPONENTS

Icon Button

Explore the Icon Button component and try its interactive examples.

INTERACTIVE PREVIEW

Preview

Install the example’s packages with pnpm add lucide-react.

Loading preview…
GET STARTED

Installation

Install the component source via shadcn Registry, the BIU CLI, or as an npm package.

TERMINAL / pnpm
pnpm dlx shadcn add @biudev/icon-button

First time using @biudev? Map "@biudev": "https://ui.biu.dev/r/0.1.0/{name}.json" under registries in your components.json (see setup).

Usage

Start with this example, then adjust the import path for your project.

Install the example’s packages with pnpm add lucide-react.

EXAMPLE / TSX
import { useState } from "react";
import { Filter, Pin, Plus } from "lucide-react";
import { IconButton } from "@/components/ui/biu/icon-button";

export function RunsToolbar({ onFilter, onNew }: { onFilter: () => void; onNew: () => void }) {
  const [pinned, setPinned] = useState(false);

  return (
    <div style={{ display: "flex", gap: 6 }}>
      <IconButton variant="secondary" label="Filter" icon={<Filter />} onClick={onFilter} />
      <IconButton
        variant="secondary"
        label="Pinned runs only"
        icon={<Pin />}
        pressed={pinned}
        onClick={() => setPinned((value) => !value)}
      />
      <IconButton variant="primary" label="New run" icon={<Plus />} onClick={onNew} />
    </div>
  );
}

Examples

Try each example or switch to its code.

API reference

Properties and defaults from the component source. An asterisk marks a required property; a dash means no explicit default.

IconButtonProps

Also accepts properties from Omit<ComponentPropsWithRef<'button'>,'children'>.

Source

Review a formatted version of the component source used by the Registry.