skip to the page
superthread
compositionsstates
system
superthread
version
2.15.1
date
24.11.26

states

what takes the rows' place while a collection loads, when it fails and when it has nothing to show, and the job's place when nothing's left. each state says what happened in its own words.

bunx --bun shadcn@latest add @mk/states

serves constellation, quanta, trisys, orbit, and artifacts.

example

retry the failed request to load two sample runs. the action restores the collection in place.

light

dark

loading

still skeleton bars at the 48 px table measure. the named status announces loading once; the bars stay silent.

light

three rows
the default

five rows
a longer collection

dark

three rows
the default

five rows
a longer collection

loading rowsthe rows take shape before their words arrive

failed

a failure is an alert with its glyph, the reason and a retry when recovery is possible. omit the callback when the reader cannot retry.

light

dark

empty

words can stand alone. add actions when the reader can fill the collection, and use the optional media slot for an app's own figure.

light

no failed runsfailed runs appear here when a task needs another look.

without actions
nothing needs recovery

nothing queuedadd a task to start the next run.

with actions and media
start from here

dark

no failed runsfailed runs appear here when a task needs another look.

without actions
nothing needs recovery

nothing queuedadd a task to start the next run.

with actions and media
start from here

clear

clear is a claim, so it prints only after a complete read. it takes a JobSheet’s box with no paper: the sentence starts where the cue does, and the reason and the door land where the why and the primary do. the panel holds the height of the work that’s gone at every width, so its edge doesn’t jump when the last thing clears.

light

dark

the sentence prints as large as its rows hold it: display at a full panel, hero below it, and a smaller step only when the words need one. its lines fill from the first.

light

dark

parts

LoadingState
rows at the table’s height, read out once. rows and label set how many and what’s loading.
FailedState
the failed glyph, what failed and why. pass onRetry when the reader can try again.
EmptyState, EmptyStateMedia, EmptyStateText, EmptyStateActions
an optional figure, what’s missing and how to fill it.
ClearState
the job sheet’s box with no paper. print it in the job’s place, right after what stands over it, and name it with aria-labelledby and the title’s id.
ClearStateTitle
the claim, one sentence with its full stop. an h1 until render says otherwise.
ClearStateReason
what makes it true, in one sentence.
ClearStateDoor
the way to everything that didn’t count.