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
.claude/rules/ui-pressable.mdWhat 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
TouchableOpacityin a button - remove
TouchableHighlightfrom a list item - choose a press component for a scrollable list
- pick an approach for animated press states
Example prompts for the agent
- Replace
TouchableOpacityin this button withPressable. - Review this list item and choose the
Pressablevariant 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.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/ui-pressable.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/ui-pressable.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/ui-pressable.mdManually: put the files in place
.clinerules/ui-pressable.mdStep 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.