Api Call
A tiny API client at work: the path types itself, a pointer presses send, a packet travels and the status, time and JSON response fill in line by line, then the next request runs. Visitors can pick a sample request, switch the request tabs, send again and copy the response.
pixikit.com/docs/blocks/illustrations/api-call
Customize
Default request0
Autoplay
Loop
Speed1.0x
Height360px
Width560px
Props
16| Name | Type | Default | Description |
|---|---|---|---|
requests | ApiCallRequest[] | DEFAULT_REQUESTS | The requests, one per sample tab. |
sendLabel | string | "Send" | The label of the send button. |
copyLabel | string | "Copy response" | What screen readers call the copy button. |
copiedLabel | string | "Copied" | The text shown briefly after copying. |
tabLabels | [string, string] | ["Params", "Body"] | The names of the two request tabs. |
emptyLabel | string | "None" | The text shown on a tab with nothing in it. |
unit | string | "ms" | The unit after the time. |
defaultRequest | number | 0 | The index of the request shown first. |
onSend | (request: ApiCallRequest) => void | None | Called when the visitor presses send. |
autoplay | boolean | true | Starts when the scene scrolls into view; when off it waits for a click on replay. |
loop | boolean | true | Plays again from the first request after the hold. |
speed | number | 1 | Playback speed multiplier. |
height | number | 360 | The height of the scene in px. |
width | number | 560 | The widest the scene grows, in px. It shrinks to fit a narrower parent. |
replayLabel | string | "Replay" | What screen readers call the replay button. |
className | string | None |