compose-focus-navigation

Implement deterministic focus navigation in Jetpack Compose apps.

1|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/leogallego/ansible-jane --skill compose-focus-navigation-leogallego
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compose-focus-navigation
Source: https://github.com/leogallego/ansible-jane/tree/main/skills/compose-focus-navigation
Command: npx skills add https://github.com/leogallego/ansible-jane --skill compose-focus-navigation-leogallego

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing focus in Jetpack Compose apps is error-prone and inconsistent across devices (TV, desktop, keyboard-first Android, and remote-control interfaces). Without explicit focus management, users struggle with navigation, initial/restored focus, and predictable traversal.

Core Features & Use Cases

  • Clear focus targets and deterministic initial focus using FocusRequester and focusRequester
  • Directional navigation control with focusProperties to map up/down/left/right
  • Reliable handling of key events to support back/escape and D-pad navigation
  • Testable focus flows with predictable focus ownership across lazy lists and modals

Quick Start

Create a FocusRequester, attach it to the target via focusRequester, and request focus after composition.

Frequently Asked Questions about compose-focus-navigation

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

FAQPage Schema
How do I set deterministic initial focus in Jetpack Compose for TV UI?

To set deterministic initial focus in Jetpack Compose for TV UI, you create a FocusRequester, attach it to the target composable via the focusRequester modifier, and call requestFocus after composition completes.

How do I control directional D-pad navigation with focusProperties in Compose?

You control directional D-pad navigation in Compose by using the focusProperties modifier to explicitly map up, down, left, and right focus traversal targets, ensuring predictable remote-control movement.

Does this focus navigation approach work for desktop and ChromeOS apps?

Yes, this focus navigation approach works for desktop and ChromeOS apps, because the guardrails and best practices apply to any keyboard-first or remote-control interface using Jetpack Compose.

Why is keyboard focus inconsistent across lazy lists and modals in Compose?

Keyboard focus becomes inconsistent across lazy lists and modals in Compose when focus ownership is not explicitly managed, requiring predictable focus flows and key event handlers to restore correct behavior.

What is the best way to handle back and escape key events in Compose TV apps?

The best way to handle back and escape key events in Compose TV apps is to implement reliable key event handlers that capture D-pad input and manage focus ownership predictably within your UI components.