Xzero UI
Pro library

Morph loaderPro

Tiny loaders that morph between shapes and fold into a check or a cross when done.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/morph-loader
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/morph-loader

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { MorphLoader } from "@/components/xzero/morph-loader/morph-loader";

export function PublishStatus({ state }: { state: "loading" | "success" | "error" }) {
  return <MorphLoader variant="ring" status={state} size={20} successLabel="Published" errorLabel="Publish failed" />;
}

API reference

MorphLoader

A tiny loader drawn from four strokes that morph between dots, bars, ring, and square shapes, then into a check or a cross when status changes.

PropTypeDefaultDescription
variant"dots" | "bars" | "ring" | "square""dots"Loading shape. Changing it while loading morphs the strokes into the new shape.
status"loading" | "success" | "error""loading"success folds the strokes into a check, error into a cross, loading gathers them back.
sizenumber24Rendered size in px. The drawing uses a 24 unit grid.
strokeWidthnumber2.5Stroke thickness in grid units for ring, square, check, and cross.
tonebooleantrueColors the check with --success and the cross with --danger. Off keeps currentColor.
labelstring"Loading"Announced while loading.
successLabelstring"Done"Announced on success.
errorLabelstring"Failed"Announced on error.
decorativebooleanfalseDrops the status role and text, for loaders inside a control that announces its own state.
classNamestring–Extra class on the root.
styleCSSProperties–Inline styles on the root.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in loaders

Guidance for AI tools

Morph loader: Tiny loaders that morph between shapes and fold into a check or a cross when done. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components