zui docs v0.0.5
GitHub ↗
Buttons and input Native Qt

Toggle Switch

Toggle Switch is a native Zui component in the buttons and input catalog, with 13 component-specific properties.

Usage

Ruby example

Paste this complete Builder example inside the app surface from the Quickstart. Replace illustrative asset paths with files from your project.

Ruby
toggle_switch checked: true, accent: "#b7ff5a" do |checked|
  puts "Enabled: #{checked}"
end
API

Component properties

13 component-specific values, plus shared item and layout properties.

checkedChecked configuration for Toggle Switch.property
busyBusy configuration for Toggle Switch.property
interactiveInteractive configuration for Toggle Switch.property
cursorCursor configuration for Toggle Switch.property
cursor_ringCursor ring configuration for Toggle Switch.property
cursor_padCursor pad configuration for Toggle Switch.property
roundedRounded configuration for Toggle Switch.property
foregroundForeground configuration for Toggle Switch.property
accentAccent configuration for Toggle Switch.property
track_heightTrack height configuration for Toggle Switch.property
track_widthTrack width configuration for Toggle Switch.property
knob_sizeKnob size configuration for Toggle Switch.property
knob_insetKnob inset configuration for Toggle Switch.property
Show 17 shared item properties
visibleenabledopacityscalerotationzwidthheightfill_widthfill_heightpreferred_widthpreferred_heightminimum_widthminimum_heightmaximum_widthmaximum_heightlayout_alignment
Interaction

Events

Subscribe with on widget, :event and keep behavior in Ruby.

changeNative event payload
hoverNative event payload