src/spinner.tsx

rome · packages/ui/src/spinner.tsx · typescript · MIT
ui

Module exposing: Spinner

// Source: https://github.com/rome-os/rome | License: MIT | Copyright 2026 Rome OS
// Provided via justclaw.it.com; keep this notice with the code.
import { forwardRef, type SVGAttributes } from "react";
import { LoaderCircle } from "lucide-react";
import { cn } from "./cn.js";

type SpinnerSize = "xs" | "sm" | "md";

/**
 * The glyph box, not the control box. A spinner sits *inside* a control rather
 * than being one, so the steps match Button's icon slot at the same size —
 * 12px on an `xs` row, 14px on a `--control-h-sm` row, and 16px on a
 * `--control-h-md` row — and a spinner swapped in for a leading icon leaves the
 * button exactly as wide as it was.
 */
const sizeClasses: Record<SpinnerSize, string> = {
  xs: "size-3",
  sm: "size-3.5",
  md: "size-4",
};

// `size` shadows lucid

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key