#255
Fast and slow loads
A LoadingBoundary around a suspending report with a fast (100 ms) and a slow (1.5 s) load button.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Fast and slow loads" pattern (@codeatlasdev/ui demo #255, navigation/loading-boundary) in my app.
Call get_demo({ ids: ["#255"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Showing a skeleton for slow data without flashing it on fast responses, in any page that awaits a loader.
Keep these library parts, with the props and tokens the demo uses:
- Button, LoadingBoundary, Stack from "@codeatlasdev/ui"
Behaviour to keep:
- `<LoadingBoundary label="Loading invoices">` wraps `<Report load={load(ms)} />`
- `{#key run}` restarts the load for each button
- `ms = 100; run++;` is the fast case and `ms = 1500; run++;` the slow one
Reduced motion: the demo handles it; keep that branch.
Keyboard: operable; keep the focus order and key handling.
Change only the copy and the data. Use the theme tokens (--ca-*), never raw colours. Library parts
- Button
@codeatlasdev/ui - LoadingBoundary
@codeatlasdev/ui - Stack
@codeatlasdev/ui
How it is built
- `<LoadingBoundary label="Loading invoices">` wraps `<Report load={load(ms)} />`
- `{#key run}` restarts the load for each button
- `ms = 100; run++;` is the fast case and `ms = 1500; run++;` the slow one
Related
Loading source.