Skip to content
Nana UI

Rental

Status

The state of a record — a unit, a tenancy, an invoice, a payment — named from the set that record belongs to, in the colour every other set uses for the same meaning. Overdue and in arrears are both danger; paid and approved are both success; a reader learns the colours once.

View .md Download

Give it a set and a value. The label and tone come from the set, so the app sends the machine value it already has and never words it twice.

Sets: unit, tenancy, invoice, payment, approval, maintenance, reading. A value no set knows is shown neutral, in sentence case.

SetValues
unitoccupied, vacant / available, reserved, notice, arrears / overdue, maintenance
tenancydraft, pending, active, notice, ended, terminated
invoicedraft, issued, partial, paid, overdue, void
paymentpending, matched, unmatched, reversed, failed
approvalpending, approved, rejected, changes, withdrawn
maintenanceopen, scheduled, progress, resolved, closed
readingdue, captured, flagged, approved
ToneMeans
SuccessSettled, in order — paid, active, approved
InfoUnder way, nothing wrong — issued, scheduled
WarningNeeds attention soon — reserved, part paid, awaiting a decision
DangerWrong now — overdue, in arrears, failed
AccentThe brand’s own — an occupied unit
AlertWork under way — maintenance, a repair in progress
ChangeAbout to change — notice given
NeutralNot in play — available, draft, void, ended

The same meaning gets the same colour in every set, which is the point of having sets: a reader who has learnt that red is “overdue” on an invoice does not have to learn it again for arrears on a unit.

variant="dot" drops the chip for a marker beside plain text, which reads better twenty rows deep.

Pass further sets as the sets property. They are looked in before the built-in ones, so they can also reword a built-in value.

document.querySelector("nana-status").sets = {
lease: { signed: { label: "Signed", tone: "success" } },
};
npm install @nana-tec/ui-components

Or copy the source in and own it:

npx @nana-tec/ui add status
import "@nana-tec/ui-components/status";
<nana-status set="invoice" value="overdue"></nana-status>
<nana-status set="unit" value="occupied" variant="dot"></nana-status>

Properties

PropertyAttributeTypeDefaultDescription
labellabelstring''Wording to use in place of the set's own
setsetstring''Which domain the value belongs to
setssetsRecord<string, StatusSet>{}Further sets to look the value up in before the built-in ones
sizesizeStatusSize'md'
tonetoneStatusTone | undefined—Colour to use in place of the set's own, for a value outside every set
valuevaluestring''The record's status, as the app stores it
variantvariantStatusVariant'pill'pill fills a chip; dot is a marker beside plain text, for dense tables

Slots

SlotDescription
(default)Replaces the label from the set

CSS parts

PartDescription
::part(base)The status container
::part(dot)The colour marker
::part(label)The status text

CSS custom properties

PropertyDescription
--nana-status-bgBackground, overriding the tone
--nana-status-colorText colour, overriding the tone
--nana-status-dotMarker colour, overriding the tone
--nana-tone-alertMarker colour of the alert tone, for work under way such as maintenance
--nana-tone-alert-strongText colour of the alert tone
--nana-tone-alert-softBackground of the alert tone
--nana-tone-changeMarker colour of the change tone, for something about to change such as notice given
--nana-tone-change-strongText colour of the change tone
--nana-tone-change-softBackground of the change tone
Explore Status interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook