Back to list
nguyenthienthanh

nativewind-generator

by nguyenthienthanh

Aura Frog — AI-powered structured development plugin for Claude Code Turn Claude Code into a full-fledged dev platform: Aura Frog brings 24 specialized agents, a 9-phase TDD workflow, built-in quality gates and 70+ commands so your team doesn’t need to manually draft prompts — just call the right command and follow guided instructions.

3🍴 2📅 Jan 22, 2026

SKILL.md


name: nativewind-generator description: "Generate React Native components styled with NativeWind (Tailwind CSS)." autoInvoke: false priority: medium triggers:

  • "NativeWind component"
  • "Tailwind React Native"
  • "styled component"

NativeWind Component Generator

Category: Mobile Development Version: 1.0.0 Dependencies: React Native, Expo, NativeWind, Tailwind CSS


Purpose

Generate React Native components styled with NativeWind (Tailwind CSS) for cross-platform mobile applications.


When to Use

  • Creating new React Native components
  • Converting Figma designs to code (Phase 3)
  • Building responsive Phone/Tablet variants
  • Rapid prototyping with utility classes

NativeWind Best Practices

Utility-First Styling

// ✅ Preferred: NativeWind
<View className="flex-1 bg-white p-4 rounded-lg shadow-md">
  <Text className="text-xl font-bold text-gray-900">Hello</Text>
</View>

// ❌ Avoid: Manual StyleSheet
<View style={styles.container}>
  <Text style={styles.title}>Hello</Text>
</View>

Responsive Design

<View className={`p-4 ${isTablet ? 'flex-row' : 'flex-col'}`}>
  <Text className={isTablet ? 'text-2xl' : 'text-lg'}>Responsive</Text>
</View>

Dark Mode

<View className="bg-white dark:bg-gray-900">
  <Text className="text-gray-900 dark:text-white">Dark Mode Ready</Text>
</View>

Pressable States

<Pressable
  className={({ pressed }) => `p-4 rounded-lg ${pressed ? 'bg-gray-200' : 'bg-white'}`}
>
  <Text>Pressable</Text>
</Pressable>

Component Templates

Screen Component

// UserProfile.phone.tsx
import { View, Text, ScrollView, TouchableOpacity } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';

interface UserProfileProps {
  userId: string;
  onEdit?: () => void;
}

export const UserProfilePhone: React.FC<UserProfileProps> = ({ onEdit }) => (
  <SafeAreaView className="flex-1 bg-gray-50">
    <ScrollView className="flex-1">
      <View className="bg-white px-4 py-6 items-center">
        <Text className="text-2xl font-bold text-gray-900">John Doe</Text>
        <Text className="text-base text-gray-500">john@example.com</Text>
      </View>
      <View className="p-4">
        <TouchableOpacity
          onPress={onEdit}
          className="bg-blue-500 px-6 py-4 rounded-lg active:bg-blue-600"
        >
          <Text className="text-white text-center font-semibold">Edit Profile</Text>
        </TouchableOpacity>
      </View>
    </ScrollView>
  </SafeAreaView>
);

Form Component

// LoginForm.tsx
import { View, Text, TextInput, TouchableOpacity, ActivityIndicator } from 'react-native';

interface LoginFormProps {
  onSubmit: (email: string, password: string) => Promise<void>;
}

export const LoginForm: React.FC<LoginFormProps> = ({ onSubmit }) => {
  const [email, setEmail] = useState('');
  const [password, setPassword] = useState('');
  const [loading, setLoading] = useState(false);

  return (
    <View className="bg-white rounded-2xl p-6 shadow-xl">
      <Text className="text-2xl font-bold text-gray-900 mb-6">Welcome Back</Text>

      <View className="mb-4">
        <Text className="text-sm font-medium text-gray-700 mb-2">Email</Text>
        <TextInput
          value={email}
          onChangeText={setEmail}
          className="bg-gray-50 border border-gray-300 rounded-lg px-4 py-3"
        />
      </View>

      <TouchableOpacity
        onPress={() => onSubmit(email, password)}
        disabled={loading}
        className={`py-4 rounded-lg ${loading ? 'bg-gray-300' : 'bg-blue-500'}`}
      >
        {loading ? <ActivityIndicator color="white" /> : (
          <Text className="text-white text-center font-semibold">Sign In</Text>
        )}
      </TouchableOpacity>
    </View>
  );
};

Common Patterns

PatternNativeWind Class
Flex containerflex-1
Padding 16pxp-4
Margin top 8pxmt-2
Background whitebg-white
Text 16pxtext-base
Font boldfont-bold
Center itemsitems-center
Border radius 8pxrounded-lg
Shadowshadow-md

Quick Patterns

// List Item
<View className="bg-white border-b border-gray-200 p-4">
  <Text className="text-base font-semibold">Title</Text>
</View>

// Card with Shadow
<View className="bg-white rounded-xl shadow-lg p-6 mb-4" />

// Badge
<View className="bg-blue-100 px-3 py-1 rounded-full">
  <Text className="text-blue-800 text-xs font-medium">New</Text>
</View>

// Flex Row
<View className="flex-row justify-between items-center">
  <Text>Left</Text>
  <Text>Right</Text>
</View>

File Structure

components/
├── UserProfile/
│   ├── UserProfile.tsx          # Main (shared logic)
│   ├── UserProfile.phone.tsx    # Phone layout
│   ├── UserProfile.tablet.tsx   # Tablet layout
│   └── index.ts                 # Barrel export

Tailwind Config

// tailwind.config.js
module.exports = {
  content: ["./App.{js,tsx}", "./src/**/*.{js,tsx}"],
  theme: {
    extend: {
      colors: {
        primary: { 500: '#0ea5e9', 600: '#0284c7' },
        success: { 500: '#10b981' },
        error: { 500: '#ef4444' }
      }
    }
  }
};

Success Criteria

  • ✅ Utility classes for 90%+ of styling
  • ✅ Responsive across Phone/Tablet
  • ✅ TypeScript types for all props
  • ✅ Proper accessibility labels
  • ✅ Minimal StyleSheet usage
  • ✅ Unit tests included

References: NativeWind | Tailwind CSS Version: 1.0.0 | Last Updated: 2025-11-28

Score

Total Score

65/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon