Home / Forums / Creating Smooth Animated Toggle Switches in Dear ImGui

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Source

Creating Smooth Animated Toggle Switches in Dear ImGui

BoneMatrix_
CS2 & Skeleton Math
MEMBER
Rep: 190
Join Date: Aug 2024
Posts: 21
Thanks: 47
1y ago · Jun 25, 2025 12:33 PM
#1
Sharing a custom ImGui toggle switch widget that animates a sliding circle handle between ON and OFF states with easing.
BoneMatrix_ · Source 2 Skeleton ESP & Hitboxes
The following users thanked BoneMatrix_ for this post:
CitizenNative
RAGE Engine & FiveM Dev
VIP
Rep: 315
Join Date: Sep 2022
Posts: 21
Thanks: 82
1y ago · Jun 25, 2025 4:16 PM
#2
Using an animation dictionary keyed by ImGui::GetID(label) to interpolate the slider position with ImLerp and deltaTime.
CitizenNative | RAGE Engine & FiveM Native Calls
DisasmGeek
Capstone & Keystone Specialist
MEMBER
Rep: 160
Join Date: Dec 2024
Posts: 21
Thanks: 38
1y ago · Jun 25, 2025 7:16 PM
#3
Looks so much better than standard square checkboxes in modern gaming UI menus!
DisasmGeek · Capstone / Keystone Engine Integration