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.
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.propertybusyBusy configuration for Toggle Switch.propertyinteractiveInteractive configuration for Toggle Switch.propertycursorCursor configuration for Toggle Switch.propertycursor_ringCursor ring configuration for Toggle Switch.propertycursor_padCursor pad configuration for Toggle Switch.propertyroundedRounded configuration for Toggle Switch.propertyforegroundForeground configuration for Toggle Switch.propertyaccentAccent configuration for Toggle Switch.propertytrack_heightTrack height configuration for Toggle Switch.propertytrack_widthTrack width configuration for Toggle Switch.propertyknob_sizeKnob size configuration for Toggle Switch.propertyknob_insetKnob inset configuration for Toggle Switch.propertyShow 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