Status Mark

The toast's loading-then-done, for any control: a resting icon turns into the spinner, and the spinner turns into a tick or a cross that draws itself in. Every 'work, then result' moment uses it, so the motion is the same everywhere.

BetaReady to use. Its API can still change in a minor release; the changelog says when.

import { StatusMark } from "@leap-crm/design-system";

Playground

Change a prop and the component follows. Its code is under Props.

Props

state

Best practices

When to use it, and the rules that apply in particular places.

GuidancePractice
DoUse it wherever a control does work and then shows the result, like copying a matter number or uploading a document, so every such moment moves the same way.
DoPass the control's resting icon as children, so the mark sits in the icon's place before and after the work.
DoSay what happened in the control's text or a live region, like "Copied" or "Upload failed". The mark is decorative, and the tick and cross differ in shape, not only colour.
DoSet the colour on the parent, like the success text colour for done. The mark draws in the current text colour.
Don'tBuild this into a Button yourself. Pass showResult and return a Promise from onClick; the button runs the same spinner, tick and cross.
Don'tAdd your own delay before switching from busy to done. Busy already plays at least one full pass, so a quick job never flashes.

Props

PropTypeDefaultDescription
state *"idle" | "busy" | "done" | "error"—idle shows the icon you pass; busy the spinner; done a tick and error a cross, each drawing itself in.
childrenReactNode—The resting glyph, like a copy or upload icon. Leave it out to show nothing while idle.
classNamestring—Classes added to the root element, merged with its own. Tokens only.

Code

What the playground shows, ready to copy.

import { StatusMark } from "@leap-crm/design-system";

<StatusMark state="busy" />