Skip to content

pivotick v3.0.0


pivotick / AsyncContent / AsyncContentOptions

Interface: AsyncContentOptions ​

Defined in: interfaces/AsyncContent.ts:94

What the library shows while a content hook's promise is in flight, and what it shows if that promise rejects. Both are optional — the built-in skeleton and error affordance follow the active theme.

Synchronous hooks never see either of these: they commit in the same frame, exactly as they always did.

Example ​

ts
UI: {
    asyncContent: {
        placeholder: (surface) => surface === 'tooltip' ? 'Loading…' : mySkeleton(),
        error: 'Could not load',
    },
}

Properties ​

error? ​

optional error: Renderable | (surface, error) => Renderable

Defined in: interfaces/AsyncContent.ts:105

Shown in the slot when an async hook rejects. An aborted render is not a failure and never reaches this.

Default ​

ts
a compact themed error line

placeholder? ​

optional placeholder: Renderable | (surface) => Renderable

Defined in: interfaces/AsyncContent.ts:99

Shown in the slot while an async hook is pending.

Default ​

ts
a themed skeleton