Code Type
An editor card that writes code by itself: tokens type in with a blinking caret, then the checks run one after another and a done label appears. Visitors can switch file tabs, copy the code and replay the scene.
pixikit.com/docs/blocks/illustrations/code-type
Customize
Default file0
Autoplay
Loop
Speed1.0x
Height360px
Width560px
Props
14| Name | Type | Default | Description |
|---|---|---|---|
files | CodeTypeFile[] | DEFAULT_FILES | The files, one tab each; the first three are used. |
checks | string[] | DEFAULT_CHECKS | The checks that run after the typing ends, one row each. |
doneLabel | string | "All checks pass" | The label that appears when every check has passed. |
copyLabel | string | "Copy code" | What the copy button is called. |
copiedLabel | string | "Copied" | The label shown for a moment after copying. |
defaultFile | number | 0 | The file the scene opens on. |
onFileChange | (index: number) => void | None | Called with the index when the file changes. |
autoplay | boolean | true | Starts when the scene scrolls into view; when off it waits for a click on replay. |
loop | boolean | true | Plays on to the next file 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 |