Data state
v0.64.0, changelogBetaOne contract for what a data region shows while it loads, when it is empty, failed, forbidden, out of date or ready.
API reference
Generated from the types. Every part also takes className.
DataState
- staterequired
"loading" | "empty" | "error" | "forbidden" | "stale" | "ready"- error
{ code: string; message?: string } | nullForerror: the code picks the copy.- onRetry
() => voidShows Try again onerrorandstale.- retrying
boolean = falseWhile the retry runs: the button keeps its place and shows it is busy.- updatedAt
stringWhen the shown data was fetched, already formatted (a clock time, "2 min ago"), for the stale notice.- empty
MessageThe empty state's icon, words and the one action that fills it ("Add device").- forbidden
MessageThe forbidden state's words, e.g. which permission is missing and who grants it.- skeleton
ReactNodeThe shape of the content while loading; default three lines of bones.- size
"panel" | "inline" = "panel"panel(default) in a card or a section;inlinein a table, a list or a small panel.- labels
Partial<DataStateLabels>- children
ReactNodeThe content, shown when ready and when stale.