navigation-event

Intercept back gestures and run Predictive Back animations using the NavigationEvent library in Compose Android.

9.3k|601|Updated Mar 16, 2026
Ready to run
npx skills add https://github.com/android/skills --skill navigation-event-android
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: navigation-event
Source: https://github.com/android/skills/tree/main/navigation/navigation-event
Command: npx skills add https://github.com/android/skills --skill navigation-event-android

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires androidx.navigationevent, androidx.navigationevent-compose, and includes references (resource) components.

What problem does it solve? Intercepting back gestures and running Predictive Back animations in Jetpack Compose Android apps, especially during migration from legacy back handlers on SDK 36+. ## Core Features & Use Cases - Intercept back gestures using NavigationEventDispatcher - Implement Predictive Back animations with NavigationEventTransitionState - Handle parent-child dispatcher scoping in ViewPagers and tabs - Migrate from legacy BackHandler to NavigationBackHandler - Use cases include dialog and nested navigation containers ## Quick Start Add the androidx.navigationevent and androidx.navigationevent-compose dependencies to your build.gradle.kts and set compileSdk to 36 or higher.

Frequently Asked Questions about navigation-event

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I intercept back gestures in Jetpack Compose Android?▼

Use the NavigationBackHandler composable with a NavigationEventState to intercept back gestures and trigger onBackCompleted callbacks.

What is the NavigationEvent library?▼

The NavigationEvent library provides a Kotlin Multiplatform solution for integrating system-level navigation events into Android applications using a dispatcher-handler model.

How to migrate from BackHandler to NavigationBackHandler?▼

Replace legacy BackHandler with NavigationBackHandler in your composables and ensure the project targets compile SDK 36 or higher.

Does this support ViewPagers and nested navigation?▼

Yes, use rememberNavigationEventDispatcherOwner to create child dispatchers for ViewPagers and tabbed interfaces to handle parent-child scoping.

What compile SDK version is required?▼

The project must target compile SDK 36 or higher to use the NavigationEvent library features.

How to handle predictive back animations?▼

Observe the transitionState of NavigationEventState to get progress and swipe edge for animating UI components during back gestures.