Status

A small progress mark in quarter steps. Not measured yet looks different from nothing done.

@patternmode/status

  • Colour audit
  • Type roles
  • Dark mode review

Reference

States and variants

Values from 0 to 100 snap to the nearest quarter. Colours come from your theme.

  • Fill and border

    variant="fill" | "border"
  • Accent and muted

    tone="accent" | "muted"
  • Unknown and empty

    status="null" | value={0}
  • Sizes

    size="2xs" to "3xl"
  • Your own colours

    color, trackColor
  • On a dark card

    --patternmode-status-surface

Install and use

Pass a value or a named status. Add a label whenever the mark carries meaning on its own.

npm i @patternmode/status motion
import { StatusMark } from "@patternmode/status";
import "@patternmode/status/styles.css";

<StatusMark value={75} label="Almost complete" color="#315c4b" trackColor="#edeae2" />
<StatusMark status="null" label="Not measured yet" />

Core API

StatusMark

Animated SVG status mark for discrete progress steps.

value
numberNumeric progress input. Values are clamped from 0 to 100 and snapped to the nearest quarter step.
status
"null" | "empty" | "quarter" | "half" | "three-quarter" | "full"Named progress step. Use null only when progress is explicitly not yet known or measured.
tone
"neutral" | "accent" | "muted""neutral"Visual emphasis treatment. Tone changes color only.
size
"2xs" | "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl""base"Patternmode size token used for the mark dimensions.
motion
"smooth" | "snap" | "reduced" | false"smooth"Transition preset for movement between progress steps.
variant
"fill" | "border""fill"Visual treatment for known progress. Null progress renders the same dashed placeholder in every variant.
color
stringOptional CSS color for active progress. Overrides tone.
trackColor
stringOptional CSS color for inactive track and placeholder structure.
label
stringAccessible label. Omit only when adjacent text already names the same state and the mark should be decorative.

Accessibility

A mark with a label is an image with a name. Without one it is hidden from assistive technology.

label
Gives the mark role="img" and that name. Without it the mark is aria-hidden.
Null
Use for progress nobody has measured yet. Zero means measured and empty.
Reduced motion
Changes snap instead of animating. Set motion={false} to always snap.

Package

Package
@patternmode/status
Version
0.4.7
Needs
react, react-dom, motion
Licence
MIT