Skip to content
Agentmart
Submit a tool

kmp-compose-tv

Compose for TV patterns: TvLazyRow/Column, focusable cards, FocusRequester, D-pad navigation, and 10-foot UI composables

Skill by giolaq

IndexedMIT-0★ 4
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/giolaq-kmp-compose-tv

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Compose for TV patterns: TvLazyRow/Column, focusable cards, FocusRequester, D-pad navigation, and 10-foot UI composables

Use cases: design

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/kmp-compose-tv

What's inside

Skill name
kmp-compose-tv
Description
Compose for TV patterns: TvLazyRow/Column, focusable cards, FocusRequester, D-pad navigation, and 10-foot UI composables
License
MIT-0
Instructions
250 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Compose for TV

> The Android TV app uses `androidx.tv:tv-foundation` and `androidx.tv:tv-material` for TV-optimized Compose components. These provide built-in D-pad navigation, focus handling, and TV-appropriate interaction patterns.

## Core TV components

### TvLazyRow — horizontal content rails

```kotlin
import androidx.tv.foundation.lazy.list.TvLazyRow
import androidx.tv.foundation.lazy.list.items

TvLazyRow(
    contentPadding = PaddingValues(horizontal = 48.dp),
    horizontalArrangement = Arrangement.spacedBy(16.dp),
) {
    items(contentItems, key = { it.id }) { item ->
        TVCard(
            item = item,
            onItemClick = { /* navigate to detail */ },
            onItemFocused = { /* update hero banner */ },
        )
    }
}
```

**When to use:** Any horizontal scrolling content row — category rails, "continue watching", recommendations.

**Key points:**
- Always provide `key = { it.id }` for stable focus restoration
- `contentPadding` with 48dp horizontal gives breathing room from screen edges
- `Arrangement.spacedBy(16.dp)` for consistent card spacing

### TvLazyColumn — vertical scrollable layout

```kotlin
import androidx.tv.foundation.lazy.list.TvLazyColumn

TvLazyColumn(
    modifier = Modifier.fillMaxWidth().weight(1f),
    contentPadding = PaddingValues(top = 24.dp, bottom = 48.dp),
) {
    categoryList.forEachIndexed { index, (genre, items) ->
        item {
            ContentRow(title = genre, items = items)
        }
    }
}
```

**When to use:** Home screen layout containing multiple rails, settings lists, any vertical scroll.

### Surface (tv-material) — focusable containers

```kotlin
import androidx.tv.material3.Surface
import androidx.tv.material3.ExperimentalTvMaterial3Api
import androidx.tv.material3.ClickableSurfaceDefaults

@OptIn(ExperimentalTvMaterial3Api::class)
Surface(
    onClick = { onItemClick(item) },
    modifier = modifier.width(220.dp).aspectRatio(16f / 9f),
    tonalElevation = if (isFocused) 8.dp else 2.dp,
    colors = ClickableSurfaceDefaults.colors(
        containerColor = Color.Transparent,
        focusedContainerColor = Color.Transparent,
    ),
    shape = ClickableSurfaceDefaults.shape(shape = RoundedCornerShape(8.dp)),
) {
    // Card content
}
```

**Key:** `Surface` from `androidx.tv.material3` (not regular material3) handles focus states natively. It responds to D-pad select without custom click handling.

## Focus management

### FocusRequester — programmatic focus control

```kotlin
val focusRequester = remember { FocusRequester() }

// Apply to the element that should receive initial focus
TvLazyRow {
    items(items) { item ->
        TVCard(
            modifier = if (item == items.first()) {
                Modifier.focusRequester(focusRequester)
            } else Modifier,
        )
    }
}

// Request focus after content loads
LaunchedEffect(items) {
    if (items.isNotEmpty()) {
        focusRequester.requestFocus()
    }
}
```

**When to use:**
- Setting initial focus when a screen loads
- Restoring focus after data refresh
- Moving focus programmatically (e.g., after dialog dismissal)

### onFocusChanged — reacting to focus

```kotlin
Modifier.onFocusChanged { focusState ->
    isFocused = focusState.isFocused
    if (focusState.isFocused) {
        onItemFocused(item)  // e.g., update hero banner
    }
}
```

**Pattern:** The template uses focus changes on cards to drive the hero banner. When a card receives focus, it notifies the parent, which updates the hero image with a debounced crossfade.

From giolaq/tv-build-harness, MIT-0.

More from giolaq/tv-build-harness

Signals

Stars
4
Forks
0
Open issues
3
Last commit (this folder)
Jun 24, 2026 (4 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT-0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from giolaq

Cite this page

kmp-compose-tv skill. Agent Mart. https://agentmart.dev/skills/giolaq-kmp-compose-tv (last updated 2026-10-24)