Skip to content

ToggleSwitch

Sliding switch control with smooth animated thumb transition and optional label.

Overview

ToggleSwitch provides a modern sliding toggle switch. When clicked, the circular thumb smoothly glides across the rounded pill track.

Settings Switch

ToggleSwitch darkTheme = new ToggleSwitch("Dark Theme")
        .checked(true);
darkTheme.onCheckedChanged(e -> applyTheme(e.newValue()));