Skip to content

    Browse components

    Morphy Button

    A pill that morphs into a spinning circle while loading, then pops a drawn check on success.

    Open
    Customize
    idle
    loading
    success

    Installation

    npx shadcn@latest add @glint-ui/morphy-button

    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/morphy-button.json

    Usage

    import { MorphyButton } from "@/components/ui/morphy-button";
    
    const [status, setStatus] = useState<MorphyStatus>("idle");
    
    <MorphyButton
      status={status}
      onClick={async () => {
        setStatus("loading");
        await save();
        setStatus("success");
      }}
    >
      Save changes
    </MorphyButton>

    Props

    PropTypeDefaultDescription
    childrenReactNode—Button label.
    status"idle" | "loading" | "success""idle"Visual state. The demo cycles it on click.
    successColorstring"#22c55e"Fill color in the success state.
    classNamestring—Extra classes for the root element.