Skip to content
API reference

blocks/async-state

Import
import * as api from "@fungi.computer/caps/blocks/async-state";
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”
Signature
type AsyncStateValue = "loading" | "empty" | "error" | "content";

Supported AsyncStateValue values.


AsyncStatePropstype alias

Section titled “AsyncStateProps”
Signature
type AsyncStateProps = Omit<HTMLAttributes<HTMLDivElement>, "content"> & object;

Props accepted by AsyncState.

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”
Signature
const AsyncState: ForwardRefExoticComponent<
Omit<HTMLAttributes<HTMLDivElement>, "content"> &
object &
RefAttributes<HTMLDivElement>
>;

Selects a caller-rendered state region without fetching or inventing copy.