Skip to content
PixiKit

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
NameTypeDefaultDescription
filesCodeTypeFile[]DEFAULT_FILESThe files, one tab each; the first three are used.
checksstring[]DEFAULT_CHECKSThe checks that run after the typing ends, one row each.
doneLabelstring"All checks pass"The label that appears when every check has passed.
copyLabelstring"Copy code"What the copy button is called.
copiedLabelstring"Copied"The label shown for a moment after copying.
defaultFilenumber0The file the scene opens on.
onFileChange(index: number) => voidNoneCalled with the index when the file changes.
autoplaybooleantrueStarts when the scene scrolls into view; when off it waits for a click on replay.
loopbooleantruePlays on to the next file 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