Skip to content
PixiKit

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
NameTypeDefaultDescription
requestsApiCallRequest[]DEFAULT_REQUESTSThe requests, one per sample tab.
sendLabelstring"Send"The label of the send button.
copyLabelstring"Copy response"What screen readers call the copy button.
copiedLabelstring"Copied"The text shown briefly after copying.
tabLabels[string, string]["Params", "Body"]The names of the two request tabs.
emptyLabelstring"None"The text shown on a tab with nothing in it.
unitstring"ms"The unit after the time.
defaultRequestnumber0The index of the request shown first.
onSend(request: ApiCallRequest) => voidNoneCalled when the visitor presses send.
autoplaybooleantrueStarts when the scene scrolls into view; when off it waits for a click on replay.
loopbooleantruePlays again from the first request after the hold.
speednumber1Playback speed multiplier.
heightnumber360The height of the scene in px.
widthnumber560The widest the scene grows, in px. It shrinks to fit a narrower parent.
replayLabelstring"Replay"What screen readers call the replay button.
classNamestringNone

Related