Skip to main content
rule CX Codex

ui-pressable — Claude Code rule: what it does, how to install

ui-pressable is a Claude Code rule for choosing touch components in React Native. It applies when an agent adds or edits buttons and list items.

AGPL-3.0 ★ 88 updated 2026-11-17

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/ui-pressable.md
Open on GitHub

What ui-pressable does

The ui-pressable rule directs React Native code to use Pressable rather than TouchableOpacity or TouchableHighlight. The component can come from react-native or react-native-gesture-handler.

For scrollable lists, it points to the gesture-handler version when the list also uses that package’s ScrollView. Animated press states use GestureDetector with Reanimated shared values instead of a Pressable style callback.

What it helps with

  • replace TouchableOpacity in a button
  • remove TouchableHighlight from a list item
  • choose a press component for a scrollable list
  • pick an approach for animated press states

Example prompts for the agent

  • Replace TouchableOpacity in this button with Pressable.
  • Review this list item and choose the Pressable variant for its scrolling setup.
  • How should this animated press state follow ui-pressable?

How to install ui-pressable

Manually: put the files in place

.claude/rules/ui-pressable.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about ui-pressable

How do I install ui-pressable in Claude Code?

Add the rule file at .claude/rules/ui-pressable.md.

What does ui-pressable do?

It directs React Native code toward Pressable instead of TouchableOpacity or TouchableHighlight, and describes a gesture-handler option for scrollable lists.

How does ui-pressable handle animated press states?

It points to GestureDetector with Reanimated shared values instead of a Pressable style callback.

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set47

The whole set →
animation-derived-value animation-derived-value is a Claude Code rule for computing one animated shared value from another. It applies to React Native Reanimated code that derives values. CX Codex +1 ★ 88repo stars fonts-config-plugin fonts-config-plugin is a Claude Code rule that embeds Expo fonts at build time. It directs the assistant to configure the expo-font plugin instead of runtime loaders. CX Codex +1 ★ 88repo stars list-performance-images list-performance-images is a Claude Code rule for loading appropriately sized images in lists. It applies when editing interfaces that display image thumbnails. CX Codex +1 ★ 88repo stars imports-design-system-folder imports-design-system-folder is a Claude Code rule that forbids importing UI packages directly into application code. All components must pass through a local design system directory. CX Codex +1 ★ 88repo stars ui-safe-area-scroll ui-safe-area-scroll is a Claude Code rule that enforces native iOS safe area handling in React Native ScrollViews. It stops layout jumping during keyboard transitions. CX Codex +1 ★ 88repo stars design-system-compound-components design-system-compound-components is a Claude Code rule that forbids raw string children in non-text components. It enforces compound structures like ButtonText and ButtonIcon across the design system. CX Codex +1 ★ 88repo stars ui-expo-image ui-expo-image is a Claude Code rule that swaps React Native's default Image for expo-image. It guides code generation toward blurhash placeholders, disk caching, and list recycling. CX Codex +1 ★ 88repo stars js-hoist-intl js-hoist-intl is a Claude Code rule that moves Intl formatter creation out of renders and loops. It applies to JavaScript code that formats dates, numbers, or relative time. CX Codex +1 ★ 88repo stars

Project sponsors

Companies that keep this analytics open