Skip to content
v0.2.10

IconButton

An icon-only action with a required accessible name.

Preview

Use IconButton

IconButton is a named export of @flood-md/react. Connect the package once, then import what you use.

First time here? Connect Flood
Example import style
icon-button.tsxTSX
"use client";

import { FloodRoot, IconButton } from "@flood-md/react";
import { Plus } from "lucide-react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <IconButton label="Add idea">
        <Plus />
      </IconButton>
    </FloodRoot>
  );
}

Design notes

  • Provide a meaningful action label, rather than the name of the glyph.
  • Supply a licensed SVG. IconButton wraps it in a decorative IconSlot sized to the control.
  • Connect onClick to your host action. The interactive preview adds a local count; the basic usage snippet only shows composition.

API reference

PropValuesDefault
variant"solid" | "subtle" | "outline" | "ghost""subtle"
size"2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl""md"
loadingboolean—
labelstringRequired
Native HTML propsOmit<ButtonHTMLAttributes<HTMLButtonElement>, "aria-label">Forwarded
View TypeScript source