API reference
blocks/async-state
Import
Section titled “Import”import * as api from "@fungi.computer/caps/blocks/async-state";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | AsyncStateValue | Supported AsyncStateValue values. |
| type alias | AsyncStateProps | Props accepted by AsyncState. |
| constant | AsyncState | Selects a caller-rendered state region without fetching or inventing copy. |
AsyncStateValuetype alias
Section titled “AsyncStateValue”type AsyncStateValue = "loading" | "empty" | "error" | "content";Supported AsyncStateValue values.
AsyncStatePropstype alias
Section titled “AsyncStateProps”type AsyncStateProps = Omit<HTMLAttributes<HTMLDivElement>, "content"> & object;Props accepted by AsyncState.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description |
|---|---|---|
state |
AsyncStateValue |
The host’s explicit state; this block does not infer it from its slots. |
loading |
ReactNode |
- |
empty |
ReactNode |
- |
error |
ReactNode |
- |
content |
ReactNode |
- |
AsyncStateconstant
Section titled “AsyncState”const AsyncState: ForwardRefExoticComponent< Omit<HTMLAttributes<HTMLDivElement>, "content"> & object & RefAttributes<HTMLDivElement>>;Selects a caller-rendered state region without fetching or inventing copy.