一键导入
react-native-styling
Senior-level styling guidelines for React Native using custom theme and StyleSheet.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Senior-level styling guidelines for React Native using custom theme and StyleSheet.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | React Native Styling |
| description | Senior-level styling guidelines for React Native using custom theme and StyleSheet. |
Follow these rules strictly when styling components.
Never use inline styles unless it's strictly necessary for dynamic values (e.g., animations or dynamically computed dimensions).
// ❌ BAD
<View style={{ marginTop: 10, backgroundColor: 'red' }} />
// ✅ GOOD
<View style={styles.container} />
You must ALWAYS use the shared theme object for spacing, colors, typography, and border radius.
import { theme } from '@/shared/themes/theme';
const styles = StyleSheet.create({
container: {
padding: theme.spacing.md,
backgroundColor: theme.colors.background,
borderRadius: theme.radius.lg,
},
});
Do not hardcode hex codes or pixel padding (except for 1px borders sometimes). Always search the theme object first.
Do NOT use the bare <Text> component from react-native.
Always use the custom AppText component (located in src/components/typography/AppText) which applies correct default fonts, colors, and accessibility traits.
When creating custom UI components (like buttons, chips, inputs):
style prop.style={[styles.base, style]}.Pressable for buttons to handle complex state (e.g., pressed, hovered) more elegantly.[!TIP] Use
SafeAreaVieworuseSafeAreaInsetsfromreact-native-safe-area-contextfor screens, not manual padding, to handle notches and home indicators gracefully.
Mandatory rules and components for handling keyboard avoidance smoothly in the React Native app.
How to correctly handle and format protobuf Timestamp dates sent by the API Gateway to prevent "Invalid Date" issues.
Senior-level React Native architecture and patterns for Expo 54 apps.
Strict coding standards, naming conventions, file size limits, and typing rules.
Guidelines for managing server state, queries, and API clients in React Native.
Best practices for implementing forms with React Hook Form and Zod.