react-call v2

Examples

Real Callables you can interact with. Click into any example to see the live demo, the two-file source, and notes on when to use it.

Behaviors
Dialog

Confirm dialog

Ask the user to confirm a destructive action before it runs. Returns a boolean to the caller.

Dialog

Alert dialog

A one-button notice. The caller awaits acknowledgement; the response type is void — the act of closing is the value.

Dialog

Prompt for input

window.prompt(), but with your component. Resolves with the entered string, or null on cancel.

Dialog
Nested

Nested dialog

A Callable that opens itself. Each open instance can spawn the same Callable from inside its own JSX — the library tracks the stack and resolves each promise independently.

Dialog
Mutation flow

Save form with mutation flow

A dialog with an async submit. useMutationFlow tracks pending; on throw, the call stays open so the user can retry without losing their input.

Notification
Upsert

Progress toast

A singleton toast that updates itself as work progresses. Uses upsert() so consecutive calls mutate the same instance.

Notification
Stacking

Auto-dismissing error

A transient banner that closes itself via setTimeout. Multiple calls stack — each error gets its own banner.

Notification
Update

Live status update

A pinned status pill. The caller pushes new props into the open call as work advances — same instance, updated from the outside via the promise reference.

Picker

Item picker

Show a list and resolve with the chosen item. Caller-side cancellation returns null; selecting an item returns the object itself.

Picker

Color picker

A grid of swatches. The current value is forwarded as a prop so the picker can render it as selected; resolves with the chosen hex or null.

Menu

Context menu

A positioned menu opened on right-click. The caller forwards the cursor coordinates so the Callable renders at the click site.

Menu

Command palette (⌘K)

A searchable list of actions. Keyboard-driven: arrow keys to navigate, Enter to run, Esc to dismiss.

Drawer

Bottom sheet

Slides up from the bottom — the mobile-native pattern for action menus and quick choices.

Drawer

Settings drawer

A panel that slides in from the edge. Props carry the initial settings as plain data; the Callable owns its own form state and resolves with the saved values, or null if the user dismisses.

Overlay

Image lightbox

Click a thumbnail, open the full image as an overlay. The Callable closes on backdrop click or Escape.

Flow

Multi-step wizard

A signup flow with three steps and a back/forward navigation. State lives inside the Callable; the caller awaits a single structured response.

Flow

Permission consent

OAuth-style "do you allow X?" prompt. Resolves with allow or deny — a tagged response, not a boolean.

17 of 17 examples