Skip to content

    Browse components

    State Icon

    One status icon that morphs between idle dot, spinning arc, a ring that closes into a popping check, and a shaking cross.

    Open
    Customize
    idle
    loading
    success
    error

    Installation

    npx shadcn@latest add @glint-ui/state-icon

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/state-icon.json

    Usage

    import { StateIcon } from "@/components/ui/state-icon";
    
    <StateIcon status={saving ? "loading" : error ? "error" : saved ? "success" : "idle"} />

    Props

    PropTypeDefaultDescription
    status"idle" | "loading" | "success" | "error""idle"Current state. The demo's Deploy button cycles it.
    sizenumber48Diameter in px.
    successColorstring"#22c55e"Success color.
    errorColorstring"#ef4444"Error color.
    labelsReactNode—Screen-reader text per status, e.g. { success: "Saved" }.
    classNamestring—Extra classes for the root element.