Skip to content
v0.2.10

IconSlot

Consistent geometry for a host-supplied SVG icon.

Preview

Use IconSlot

IconSlot 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-slot.tsxTSX
"use client";

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

export function Example() {
  return (
    <FloodRoot>
      <IconSlot size="md"><ArrowRight /></IconSlot>
    </FloodRoot>
  );
}

Design notes

  • No glyph pack ships in the React package. Keep the license of the host's icon artwork.
  • Without label the slot is decorative. With label it exposes role="img" and an accessible name.
  • Use an SVG rather than a text character. Avoid inline SVG sizing styles that override the slot.

API reference

PropValuesDefault
size"2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl""md"
labelstring—
Native HTML propsHTMLAttributes<HTMLSpanElement>Forwarded
View TypeScript source