rn-shared-ui-catalog
Skill4 starsChanged 4 months agoMIT-0View on GitHub
Catalog of available shared-ui components: what exists in the template, how to reuse vs create new
In this repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- 10ft-uiSkill
- amazon-devices-vega-app-performanceSkill
- amazon-devices-vega-best-practicesSkill
- amazon-devices-vega-setup-sdkSkill
- android-tv-testingSkill
- changelog-static-siteSkill
- creative-tv-uiSkill
- eas-buildSkill
- expo-tv-configSkill
- firetv-leanbackSkill
- kmp-build-commandsSkill
- kmp-compose-tvSkill
- kmp-data-layerSkill
- kmp-navigationSkill
- kmp-template-anatomySkill
- kmp-themingSkill
- kmp-verify-patternsSkill
- metaSkill
- rn-manifest-wiringSkill
- rn-spatial-navigationSkill
- rn-template-anatomySkill
- rn-themingSkill
- vega-sdkSkill
- video-playerSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
If the layout matches but composition differs, compose existing components into a new screen file.
- Distinctive: line 18
Only if neither (1) nor (2) applies, write a new screen — and then look at existing screens for patterns before starting.
- Very specific: line 20
If you find yourself writing a <View> with a <FlatList> from scratch, stop.
- Very specific: line 26
When to use: Always. It is the app's chrome.
- Distinctive: line 99
Reimplementing the drawer as a custom sidebar: Always loses focus edge cases.
- Very specific: line 101
Custom
<Tile>with<TouchableOpacity>: Use <Pressable> so the template's focus styles work.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Shared UI catalog
The template ships a working app. Reuse before generating. Free-form code is a last resort, not a first move. Every component in this catalog is battle-tested for TV focus, performance, and platform splits.
The rule
For every screen the planner requests:
- Find the closest existing screen in
packages/shared-ui/screens/. Use it as-is if the difference is just data binding. - If the layout matches but composition differs, compose existing components into a new screen file.
- Only if neither (1) nor (2) applies, write a new screen — and then look at existing screens for patterns before starting.
If you find yourself writing a <View> with a <FlatList> from scratch, stop. The template has Grid. Use it.
Component reference
<Drawer>
Purpose: Left-side collapsible navigation. Hosts the app's primary routes.
When to use: Always. It is the app's chrome. Don't replace it unless the planner explicitly says navigation.type !== "drawer".
Customize: Items via navigation/routes.ts; theme tokens for background, accent, focused-item style.
Do not: Reimplement as tabs. If the planner asks for tabs, swap the navigator at the navigation layer, don't fork the drawer.
<Hero>
Purpose: Top-of-screen dynamic banner. Updates as the user focuses tiles in the row below.
When to use: Any "browse" screen with a featured item. Home, category landing.
Inputs: focusedItem (auto-wired by parent), image URL, title, description, CTA.
Gotcha: Updates on focus change — too many state writes can drop frames. The component already debounces; don't add another debounce on top.
<Grid>
Purpose: Responsive grid of tiles. Handles focus, virtualization, edge wrapping.
When to use: Any catalog view — categories, search results, watchlist.
Inputs: items, renderItem (optional; defaults to <Tile>), columns (auto by screen size).
Gotcha: Pass stable keyExtractor. Without it, focus jumps on re-render. The template defaults to item.id; if your manifest uses a different key, supply one.
<Rail>
Purpose: Horizontal scrolling row of tiles (Netflix-style).
When to use: Home-page sections, "more like this" recommendations.
Inputs: title, items, onItemFocus (often used to drive the parent <Hero>).
Gotcha: Focus restoration on return — the template handles this via <TVFocusGuide> internally. Don't wrap it in another guide.
<Tile>
Purpose: Single content card. Thumbnail, title, focus ring. When to use: Inside Grid or Rail. Rarely standalone. Customize via theme: Focus border color, scale-on-focus amount, label visibility. Anti-pattern: Building your own card. The focus behavior here is non-trivial; don't recreate it.
<Player>
Purpose: Full-screen video player based on react-native-video.
When to use: The player screen. That's it.
Inputs: source (URL + type), metadata (title, etc.), onClose.
Customize: Controls overlay, scrub-bar style. Player core logic — don't.
Platform notes: Vega has its own player. See video-player.md.
<DetailHeader>, <EpisodeList>, <RelatedRail>
Purpose: Composable pieces of the detail screen. When to use: Building detail variants (movie vs series vs live).
Existing screens
| Screen | File | What it does | Reuse if… |
| Home | screens/Home/ | Hero + multiple rails driven by manifest sections | Manifest has featured + categories with items |
| Category | screens/Category/ | Grid of items for one category | Drill-down from drawer/home |
| Detail | screens/Detail/ | Hero + metadata + episodes/related + Play CTA | A video is selected |
| Player | screens/Player/ | Full-screen <Player> + overlays | Detail's Play is pressed |
| Search | screens/Search/ | Text input + grid results | Catalog is large enough that a search is useful |
| Settings | screens/Settings/ | About, theme toggle, sign-out | Standard housekeeping |
Decision tree: which screen do I add?
Planner says layout: "hero+rails" → use existing Home. Pass different data via the route param.
Planner says layout: "grid" → use existing Category. Provide a category ID.
Planner says layout: "detail" → use existing Detail. Provide an item ID.
Planner says layout: "player" → use existing Player. Always.
Planner says layout: "search" → use existing Search.
Planner says layout: "settings" → use existing Settings.
None of the above → write a new screen by composing components. Start by copying the closest existing screen as scaffolding.
When to write a new component
Bar is high. New component only if:
- The visual pattern appears in at least two screens in the AppSpec.
- It can't be achieved by composing existing components.
- It has non-trivial focus behavior that warrants encapsulation.
Otherwise: inline it in the screen, and let it earn promotion to a component on the next iteration when it gets reused.
Anti-patterns
- Reimplementing the drawer as a custom sidebar. Always loses focus edge cases.
- Wrapping
<Rail>or<Grid>in your own<TVFocusGuide>. They already use one. Nested guides trap focus. - Custom
<Tile>with<TouchableOpacity>. Use<Pressable>so the template's focus styles work; better yet, use<Tile>. - Adding a fourth navigation pattern (e.g. bottom tabs on TV). Bottom tabs don't work with D-pad. If the planner emits this, override and ask.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

