Skip to content
PixiKit

Switch Panel

A settings panel being set up: a pointer flips a switch, a dependent row unfolds, an option is picked and a slider dragged, and a status pill shows saving then saved. Visitors can use the switches, the option group and the slider themselves, with the mouse or the keyboard.

pixikit.com/docs/blocks/illustrations/switch-panel

Customize

Autoplay
Loop
Speed1.0x
Height360px
Width560px

Props

12
NameTypeDefaultDescription
rowsSwitchPanelRow[]DEFAULT_ROWSThe settings, top to bottom.
titlestring"Notifications"The name in the top bar.
savingLabelstring"Saving"The status shown right after a change.
savedLabelstring"Saved"The status shown once the change is stored.
onChange(index: number, value: boolean | number) => voidNoneCalled when the visitor changes a row: a boolean for a switch, the option index for a choice, the number for a range.
autoplaybooleantrueStarts when the scene scrolls into view; when off it waits for a click on replay.
loopbooleantruePlays again from the start layout 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