Skip to content
Calm motion: animations on this site only fade, with no movement

Document status ​

The states of a document, such as draft, approved, sent, and paid, with the next step

Shows where an order, an invoice, or a contract is in its life in an ERP. For the people who approve a step, use the approval flow.

Basic
  1. Draft, done14 Nov, 10:02
  2. Approved, current state15 Nov, 16:40
  3. Sent, not yet
  4. Paid, not yet
  1. Draft, done14 Nov, 10:02
  2. Approved, current state15 Nov, 16:40
  3. Sent, not yet
  4. Paid, not yet
  5. Cancelled
  • states is the list of states in order. Each state has an id and a label. time is optional: it says when the document reached the state.
  • v-model is the id of the current state. It is filled, and it has aria-current. Done states have a tick, and states to come are dashed. Screen readers hear "done", "current state", or "not yet" after each name.
  • The button moves the document to the next state, such as "Mark as Sent", and emits advance with its id. After the last state, the button goes away.
  • stopped ends the chain with a word, such as "Cancelled". The states to come are struck through, and there is no button.
  • Change the words with labels or a label pack: title, done, current, next, and move (a function).

Usage ​

ts
import { BlessDocumentStatus } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
states*BlessDocState[]—the states in order
stoppedstring—the document stopped, for example cancelled; the chain ends with this word
labelsPartial<{ title: string; done: string; current: string; next: string; move: (state: string) => string; }>—
modelValuestring—the id of the state the document is in

Events

NamePayloadDescription
update:modelValue[value: string | undefined]
advance[id: string]

Released under the MIT License. Character names and artwork belong to their owners.