soufianekhiat/ImAnim

Animation Engine for Dear ImGui

C++

761

92 commits

updated Oct 15, 2026

See the code

README

ImAnim

Animation Engine for Dear ImGui

Version License

Windows Linux macOS

ImAnimDemo_Hero_1 0 0

ImAnim brings modern animation capabilities to ImGui applications. Write smooth UI animations with minimal code.

Version 1.0.0 - First Official Release

This is the first stable release of ImAnim, featuring a complete animation toolkit for Dear ImGui.

// Animate anything in one line
float alpha = iam_tween_float(id, channel, hovered ? 1.0f : 0.5f, 0.3f, ease, policy, dt);

Why ImAnim?

  • Immediate-mode friendly - Works naturally with ImGui's paradigm
  • Zero dependencies - Only requires Dear ImGui
  • Large easing collection - 30+ easing functions including spring physics
  • Perceptual color blending - OKLAB and OKLCH
  • Responsive layouts - Anchor-relative animations that survive window resizing

Features at a Glance

CategoryCapabilities
TweensFloat, Vec2, Vec4, Int, Color with crossfade/cut/queue policies
ClipsTimeline keyframes, looping, callbacks, chaining, stagger, variations
EasingQuad to Bounce presets, cubic-bezier, steps, spring physics, per-axis
PathsBezier curves, Catmull-Rom splines, path morphing, text along paths
TransformsPosition, rotation, scale with rotation modes
ProceduralOscillators, shake, wiggle, Perlin/Simplex noise
ColorsGradients, style interpolation, OKLAB/OKLCH blending
AdvancedLayering/blending, resolved tweens, drag feedback, scroll animation
ToolsDebug inspector, profiler, save/load, memory management

Quick Integration

Step 1: Copy im_anim.h and im_anim.cpp to your project.

Step 2: Add two lines after ImGui::NewFrame():

ImGui::NewFrame();

// Add these two lines
iam_update_begin_frame();
iam_clip_update(ImGui::GetIO().DeltaTime);

// Your UI code...

Step 3: Animate! Here's a hover effect:

bool hovered = ImGui::IsItemHovered();
float scale = iam_tween_float(
    ImGui::GetID("btn"), ImHashStr("scale"),
    hovered ? 1.1f : 1.0f, 0.2f,
    iam_ease_preset(iam_ease_out_back),
    iam_policy_crossfade,
    ImGui::GetIO().DeltaTime
);

That's it. No build system changes, no external dependencies.

Debug helper

  • Timeline for clips with tooltip helpers: ImAnimDemo_XukMAvrwhw

  • Support for delayed start: ImAnimDemo_2fQKeGBaLG

Building Examples

Windows

Open examples/ImAnim_vs2022_Win64.sln in Visual Studio 2022 and select a configuration:

ConfigurationBackend
Release_Win32_DX11Win32 + DirectX11
Release_GLFW_OpenGL3GLFW + OpenGL3
Release_SDL2_OpenGL3SDL2 + OpenGL3
Release_ImPlatformImPlatform abstraction

Debug configurations are also available for each backend.

Linux / macOS

Each backend has its own Makefile:

cd examples/glfw_opengl3
make

# or
cd examples/sdl2_opengl3
make

Cross-platform (CMake)

The CMake build compiles the demo against every backend permutation ImPlatform supports, and is what CI runs. It builds ImPlatform from the submodule, so no system Dear ImGui is needed.

cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --target ImAnimDemo_GLFW_Vulkan --parallel

Binaries land in build/bin/. Configurations whose dependencies are missing are skipped at configure time with a message, so a partial toolchain still builds whatever it can.

ConfigurationWindowsLinuxmacOS
Win32_DX11yes--
Win32_DX12yes--
SDL3_DX11yes--
GLFW_Vulkanyesyesyes
SDL3_Vulkanyesyesyes
GLFW_Metal--yes
SDL3_Metal--yes
Win32_OpenGL3yes--
GLFW_OpenGL3-yesyes
SDL3_OpenGL3-yes-

GLFW is deliberately absent from the DirectX rows: it exposes no native window handle, so the DirectX backends cannot obtain an HWND from it. Vulkan on macOS runs through MoltenVK. The Metal configurations currently compile but do not run, because ImPlatform_InitGfxAPI in ImPlatform's Metal backend still returns false pending an NSWindow accessor on the GLFW and SDL3 backends.

Documentation

Comprehensive guides for every ImAnim feature, organized by category. Each doc includes code examples and API references.

Getting Started

Core Animation

  • Tweens - Immediate-mode animation
  • Clips - Timeline-based keyframe animation
  • Easing - All 30+ easing functions

Motion & Paths

Effects

Colors & Styles

Advanced Features

Tools & Debug

  • Debug - Inspector and debugging tools
  • Advanced - Profiler, persistence, memory management

Interactive Demo

The im_anim_demo.cpp file provides a comprehensive playground for exploring all ImAnim features. Call ImAnimDemoWindow() to display it.

Demo Categories

CategoryWhat You'll Find
Easing & TweensEasing gallery, custom bezier editor, spring physics, per-axis easing
Interactive WidgetsAnimated buttons, toggle switches, hover cards, progress indicators
Clip-Based AnimationsTimeline keyframes, looping, callbacks, chaining, layering system
Procedural AnimationsOscillators, shake/wiggle effects, Perlin/Simplex noise
Motion PathsBezier curves, Catmull-Rom splines, path morphing, text along paths
Advanced InterpolationGradients, transforms, style interpolation, text stagger
UtilitiesImDrawList animations, resize-aware helpers, scroll animation, drag feedback
Debug ToolsInspector, profiler, memory stats
Stress TestPerformance benchmarks with thousands of concurrent animations

Use Cases

The demo showcases practical UI patterns you can adapt:

  • Animated Buttons - Hover scaling, press feedback, icon animations
  • Toggle Switches - Smooth state transitions with easing
  • Hover Cards - Expand/collapse with spring physics
  • List Stagger - Cascading item reveal animations
  • Grid Reveal - Wave-based grid animations
  • Dropping Cards - Physics-inspired card animations
  • Health Bars - Color gradient health indicators
  • Loading Indicators - Pulsing rings, spinning elements
  • Error Feedback - Shake effects for invalid input
  • Scroll Navigation - Smooth scroll-to-section animations
Animated Tag
ImAnimDemo_a1h8amHeJp
Ripple Button
ImAnimDemo_XVoOtKSf3G
"Wait" Button
ImAnimDemo_2RPgqEAHHm
Data Visualization
ImAnimDemo_VnmpjDbMZh
ImAnimDemo_zI6R85WazP

Showcase

Visual examples of ImAnim capabilities in action.

Stagger Animations

List StaggerGrid StaggerCard Stagger
ListGridCards

Easing & Curves

Easing GalleryCustom BezierWave Animations
EasingBezierWaves

Colors & Transforms

Color BlendingGradientTransforms
ColorGradientTransform

Paths & Text

Motion PathText EffectsVariations
PathTextVariations

Procedural & Integration

NoiseImGui WidgetsImDrawList
NoiseImGuiDrawList

Additional Examples

Oscillator WavesTransform Layers
Waves2Transform2

Contributing

Development is supported through Patreon:

Patreon

For Contributors: Regenerating Projects

The Visual Studio solution is generated using Sharpmake. To regenerate projects after modifying the build configuration:

Prerequisites: .NET 6.0 SDK or later

# First time setup (builds Sharpmake)
cd examples
bootstrap.bat        # Windows
./bootstrap.sh       # Linux/macOS

# Regenerate projects
generate_projects.bat    # Windows
./generate_projects.sh   # Linux/macOS

License

MIT License - see LICENSE for details.


Made for the Dear ImGui community

soufianekhiat/ImAnim

Animation Engine for Dear ImGui

C++

761

92 commits

updated Oct 15, 2026

See the code

README

ImAnim

Animation Engine for Dear ImGui

Version License

Windows Linux macOS

ImAnimDemo_Hero_1 0 0

ImAnim brings modern animation capabilities to ImGui applications. Write smooth UI animations with minimal code.

Version 1.0.0 - First Official Release

This is the first stable release of ImAnim, featuring a complete animation toolkit for Dear ImGui.

// Animate anything in one line
float alpha = iam_tween_float(id, channel, hovered ? 1.0f : 0.5f, 0.3f, ease, policy, dt);

Why ImAnim?

  • Immediate-mode friendly - Works naturally with ImGui's paradigm
  • Zero dependencies - Only requires Dear ImGui
  • Large easing collection - 30+ easing functions including spring physics
  • Perceptual color blending - OKLAB and OKLCH
  • Responsive layouts - Anchor-relative animations that survive window resizing

Features at a Glance

CategoryCapabilities
TweensFloat, Vec2, Vec4, Int, Color with crossfade/cut/queue policies
ClipsTimeline keyframes, looping, callbacks, chaining, stagger, variations
EasingQuad to Bounce presets, cubic-bezier, steps, spring physics, per-axis
PathsBezier curves, Catmull-Rom splines, path morphing, text along paths
TransformsPosition, rotation, scale with rotation modes
ProceduralOscillators, shake, wiggle, Perlin/Simplex noise
ColorsGradients, style interpolation, OKLAB/OKLCH blending
AdvancedLayering/blending, resolved tweens, drag feedback, scroll animation
ToolsDebug inspector, profiler, save/load, memory management

Quick Integration

Step 1: Copy im_anim.h and im_anim.cpp to your project.

Step 2: Add two lines after ImGui::NewFrame():

ImGui::NewFrame();

// Add these two lines
iam_update_begin_frame();
iam_clip_update(ImGui::GetIO().DeltaTime);

// Your UI code...

Step 3: Animate! Here's a hover effect:

bool hovered = ImGui::IsItemHovered();
float scale = iam_tween_float(
    ImGui::GetID("btn"), ImHashStr("scale"),
    hovered ? 1.1f : 1.0f, 0.2f,
    iam_ease_preset(iam_ease_out_back),
    iam_policy_crossfade,
    ImGui::GetIO().DeltaTime
);

That's it. No build system changes, no external dependencies.

Debug helper

  • Timeline for clips with tooltip helpers: ImAnimDemo_XukMAvrwhw

  • Support for delayed start: ImAnimDemo_2fQKeGBaLG

Building Examples

Windows

Open examples/ImAnim_vs2022_Win64.sln in Visual Studio 2022 and select a configuration:

ConfigurationBackend
Release_Win32_DX11Win32 + DirectX11
Release_GLFW_OpenGL3GLFW + OpenGL3
Release_SDL2_OpenGL3SDL2 + OpenGL3
Release_ImPlatformImPlatform abstraction

Debug configurations are also available for each backend.

Linux / macOS

Each backend has its own Makefile:

cd examples/glfw_opengl3
make

# or
cd examples/sdl2_opengl3
make

Cross-platform (CMake)

The CMake build compiles the demo against every backend permutation ImPlatform supports, and is what CI runs. It builds ImPlatform from the submodule, so no system Dear ImGui is needed.

cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --target ImAnimDemo_GLFW_Vulkan --parallel

Binaries land in build/bin/. Configurations whose dependencies are missing are skipped at configure time with a message, so a partial toolchain still builds whatever it can.

ConfigurationWindowsLinuxmacOS
Win32_DX11yes--
Win32_DX12yes--
SDL3_DX11yes--
GLFW_Vulkanyesyesyes
SDL3_Vulkanyesyesyes
GLFW_Metal--yes
SDL3_Metal--yes
Win32_OpenGL3yes--
GLFW_OpenGL3-yesyes
SDL3_OpenGL3-yes-

GLFW is deliberately absent from the DirectX rows: it exposes no native window handle, so the DirectX backends cannot obtain an HWND from it. Vulkan on macOS runs through MoltenVK. The Metal configurations currently compile but do not run, because ImPlatform_InitGfxAPI in ImPlatform's Metal backend still returns false pending an NSWindow accessor on the GLFW and SDL3 backends.

Documentation

Comprehensive guides for every ImAnim feature, organized by category. Each doc includes code examples and API references.

Getting Started

Core Animation

  • Tweens - Immediate-mode animation
  • Clips - Timeline-based keyframe animation
  • Easing - All 30+ easing functions

Motion & Paths

Effects

Colors & Styles

Advanced Features

Tools & Debug

  • Debug - Inspector and debugging tools
  • Advanced - Profiler, persistence, memory management

Interactive Demo

The im_anim_demo.cpp file provides a comprehensive playground for exploring all ImAnim features. Call ImAnimDemoWindow() to display it.

Demo Categories

CategoryWhat You'll Find
Easing & TweensEasing gallery, custom bezier editor, spring physics, per-axis easing
Interactive WidgetsAnimated buttons, toggle switches, hover cards, progress indicators
Clip-Based AnimationsTimeline keyframes, looping, callbacks, chaining, layering system
Procedural AnimationsOscillators, shake/wiggle effects, Perlin/Simplex noise
Motion PathsBezier curves, Catmull-Rom splines, path morphing, text along paths
Advanced InterpolationGradients, transforms, style interpolation, text stagger
UtilitiesImDrawList animations, resize-aware helpers, scroll animation, drag feedback
Debug ToolsInspector, profiler, memory stats
Stress TestPerformance benchmarks with thousands of concurrent animations

Use Cases

The demo showcases practical UI patterns you can adapt:

  • Animated Buttons - Hover scaling, press feedback, icon animations
  • Toggle Switches - Smooth state transitions with easing
  • Hover Cards - Expand/collapse with spring physics
  • List Stagger - Cascading item reveal animations
  • Grid Reveal - Wave-based grid animations
  • Dropping Cards - Physics-inspired card animations
  • Health Bars - Color gradient health indicators
  • Loading Indicators - Pulsing rings, spinning elements
  • Error Feedback - Shake effects for invalid input
  • Scroll Navigation - Smooth scroll-to-section animations
Animated Tag
ImAnimDemo_a1h8amHeJp
Ripple Button
ImAnimDemo_XVoOtKSf3G
"Wait" Button
ImAnimDemo_2RPgqEAHHm
Data Visualization
ImAnimDemo_VnmpjDbMZh
ImAnimDemo_zI6R85WazP

Showcase

Visual examples of ImAnim capabilities in action.

Stagger Animations

List StaggerGrid StaggerCard Stagger
ListGridCards

Easing & Curves

Easing GalleryCustom BezierWave Animations
EasingBezierWaves

Colors & Transforms

Color BlendingGradientTransforms
ColorGradientTransform

Paths & Text

Motion PathText EffectsVariations
PathTextVariations

Procedural & Integration

NoiseImGui WidgetsImDrawList
NoiseImGuiDrawList

Additional Examples

Oscillator WavesTransform Layers
Waves2Transform2

Contributing

Development is supported through Patreon:

Patreon

For Contributors: Regenerating Projects

The Visual Studio solution is generated using Sharpmake. To regenerate projects after modifying the build configuration:

Prerequisites: .NET 6.0 SDK or later

# First time setup (builds Sharpmake)
cd examples
bootstrap.bat        # Windows
./bootstrap.sh       # Linux/macOS

# Regenerate projects
generate_projects.bat    # Windows
./generate_projects.sh   # Linux/macOS

License

MIT License - see LICENSE for details.


Made for the Dear ImGui community

Significant stargazers

Tony Narlock

420 followers · starred Dec 2025

Rokas Kupstys

373 followers · starred Dec 2025

Borislav Stanimirov

529 followers · starred Dec 2025

Andre Weissflog

3,149 followers · starred Dec 2025