jpskill.com
🛠️ 開発・MCP コミュニティ

nativewind

React NativeでTailwind CSSの便利な書き方(className)を利用できるようにし、レスポンシブ対応やダークモード、アニメーション、プラットフォームごとのスタイル設定も可能にするSkill。

📜 元の英語説明(参考)

Use Tailwind CSS in React Native with NativeWind — write className instead of StyleSheet. Use when someone asks to "use Tailwind in React Native", "NativeWind", "style React Native with Tailwind", "className in React Native", or "utility-first styling for mobile". Covers setup, responsive design, dark mode, animations, and platform-specific styles.

🇯🇵 日本人クリエイター向け解説

一言でいうと

React NativeでTailwind CSSの便利な書き方(className)を利用できるようにし、レスポンシブ対応やダークモード、アニメーション、プラットフォームごとのスタイル設定も可能にするSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o nativewind.zip https://jpskill.com/download/15156.zip && unzip -o nativewind.zip && rm nativewind.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/15156.zip -OutFile "$d\nativewind.zip"; Expand-Archive "$d\nativewind.zip" -DestinationPath $d -Force; ri "$d\nativewind.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して nativewind.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → nativewind フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

NativeWind

概要

NativeWind を使用すると、React Native で Tailwind CSS クラスを使用できます。StyleSheet.create({ container: { backgroundColor: '#3b82f6', padding: 16, borderRadius: 12 } }) の代わりに className="bg-blue-500 p-4 rounded-xl" と記述します。Web でおなじみの Tailwind と同じものが、ビルド時にネイティブスタイルにコンパイルされます。ダークモード、レスポンシブブレークポイント、アニメーション、およびプラットフォーム固有のスタイルをサポートします。

使用場面

  • Tailwind ユーティリティを使用して React Native アプリをスタイリングする場合
  • Web 開発からの移行で、使い慣れたスタイリングが必要な場合
  • Web とモバイルで一貫したデザインシステムが必要な場合
  • テーマを手動で管理せずにダークモードをサポートしたい場合
  • モバイル UI の迅速なプロトタイピング

手順

Expo でのセットアップ

npx expo install nativewind tailwindcss react-native-reanimated react-native-safe-area-context
npx tailwindcss init
// tailwind.config.js
module.exports = {
  content: ["./app/**/*.{ts,tsx}", "./components/**/*.{ts,tsx}"],
  presets: [require("nativewind/preset")],
  theme: { extend: {} },
};
/* global.css */
@tailwind base;
@tailwind components;
@tailwind utilities;
// app/_layout.tsx — グローバル CSS のインポート
import "../global.css";
import { Stack } from "expo-router";

export default function Layout() {
  return <Stack />;
}

基本的な使い方

// components/Card.tsx — Tailwind クラスでスタイル設定
import { View, Text, Image, Pressable } from "react-native";

export function ProductCard({ product }) {
  return (
    <Pressable className="bg-white dark:bg-gray-800 rounded-2xl shadow-lg p-4 m-2 active:scale-95">
      <Image
        source={{ uri: product.image }}
        className="w-full h-48 rounded-xl"
        resizeMode="cover"
      />
      <View className="mt-3">
        <Text className="text-lg font-bold text-gray-900 dark:text-white">
          {product.name}
        </Text>
        <Text className="text-sm text-gray-500 dark:text-gray-400 mt-1">
          {product.description}
        </Text>
        <View className="flex-row items-center justify-between mt-3">
          <Text className="text-xl font-bold text-blue-600">
            ${product.price}
          </Text>
          <Pressable className="bg-blue-600 px-4 py-2 rounded-full active:bg-blue-700">
            <Text className="text-white font-semibold">Add to Cart</Text>
          </Pressable>
        </View>
      </View>
    </Pressable>
  );
}

ダークモード

// システム設定による自動ダークモード
<View className="bg-white dark:bg-gray-900">
  <Text className="text-black dark:text-white">
    システムテーマに適用
  </Text>
</View>

// プログラムによる切り替え
import { useColorScheme } from "nativewind";

function ThemeToggle() {
  const { colorScheme, toggleColorScheme } = useColorScheme();

  return (
    <Pressable onPress={toggleColorScheme} className="p-3">
      <Text className="text-gray-900 dark:text-white">
        Current: {colorScheme}
      </Text>
    </Pressable>
  );
}

プラットフォーム固有のスタイル

// プラットフォームごとの異なるスタイル
<View className="p-4 ios:pt-12 android:pt-8">
  <Text className="text-base ios:text-lg android:text-sm">
    プラットフォームを意識したテキスト
  </Text>
</View>

レスポンシブデザイン

// レスポンシブブレークポイント (タブレット/Web に便利)
<View className="flex-col md:flex-row gap-4">
  <View className="w-full md:w-1/3">
    <Text>Sidebar</Text>
  </View>
  <View className="w-full md:w-2/3">
    <Text>Main content</Text>
  </View>
</View>

例 1: Tailwind を使用したモバイル UI の構築

ユーザープロンプト: 「Tailwind CSS クラスを使用して React Native チャットアプリをスタイル設定してください。」

エージェントは、ユーティリティクラスを使用して、NativeWind でスタイル設定されたコンポーネント (メッセージバブル、入力バー、アバターグループ、ステータスインジケーター) を作成します。

例 2: 既存のアプリへのダークモードの追加

ユーザープロンプト: 「Expo アプリにダークモードを追加してください。システム設定に従うようにしたいです。」

エージェントは NativeWind をセットアップし、既存のスタイルに dark: バリアントを追加し、カラースキームプロバイダーを構成します。

ガイドライン

  • className はすべての RN コンポーネントで動作します — View, Text, Image, Pressable など。
  • dark: プレフィックスによるダークモード — デフォルトでシステム設定に従います
  • active: はプレス状態用active:scale-95, active:bg-blue-700
  • StyleSheet は不要 — Tailwind クラスはネイティブスタイルにコンパイルされます
  • ios: および android: プレフィックス — プラットフォーム固有のスタイル
  • md:, lg: によるレスポンシブ — タブレットや Web に便利
  • アニメーションには reanimated が必要animate- クラスには react-native-reanimated が必要
  • config 内のカスタム値 — 通常どおり tailwind.config.js テーマを拡張します
  • パフォーマンス — スタイルは実行時ではなく、ビルド時にコンパイルされます
  • Web 互換性 — Expo web 経由で同じクラスが Web で動作します
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

NativeWind

Overview

NativeWind lets you use Tailwind CSS classes in React Native — write className="bg-blue-500 p-4 rounded-xl" instead of StyleSheet.create({ container: { backgroundColor: '#3b82f6', padding: 16, borderRadius: 12 } }). Same Tailwind you know from web, compiled to native styles at build time. Supports dark mode, responsive breakpoints, animations, and platform-specific styles.

When to Use

  • Styling React Native apps with Tailwind utilities
  • Coming from web development and want familiar styling
  • Need consistent design system across web and mobile
  • Dark mode support without managing themes manually
  • Rapid prototyping of mobile UI

Instructions

Setup with Expo

npx expo install nativewind tailwindcss react-native-reanimated react-native-safe-area-context
npx tailwindcss init
// tailwind.config.js
module.exports = {
  content: ["./app/**/*.{ts,tsx}", "./components/**/*.{ts,tsx}"],
  presets: [require("nativewind/preset")],
  theme: { extend: {} },
};
/* global.css */
@tailwind base;
@tailwind components;
@tailwind utilities;
// app/_layout.tsx — Import global CSS
import "../global.css";
import { Stack } from "expo-router";

export default function Layout() {
  return <Stack />;
}

Basic Usage

// components/Card.tsx — Styled with Tailwind classes
import { View, Text, Image, Pressable } from "react-native";

export function ProductCard({ product }) {
  return (
    <Pressable className="bg-white dark:bg-gray-800 rounded-2xl shadow-lg p-4 m-2 active:scale-95">
      <Image
        source={{ uri: product.image }}
        className="w-full h-48 rounded-xl"
        resizeMode="cover"
      />
      <View className="mt-3">
        <Text className="text-lg font-bold text-gray-900 dark:text-white">
          {product.name}
        </Text>
        <Text className="text-sm text-gray-500 dark:text-gray-400 mt-1">
          {product.description}
        </Text>
        <View className="flex-row items-center justify-between mt-3">
          <Text className="text-xl font-bold text-blue-600">
            ${product.price}
          </Text>
          <Pressable className="bg-blue-600 px-4 py-2 rounded-full active:bg-blue-700">
            <Text className="text-white font-semibold">Add to Cart</Text>
          </Pressable>
        </View>
      </View>
    </Pressable>
  );
}

Dark Mode

// Automatic dark mode with system preference
<View className="bg-white dark:bg-gray-900">
  <Text className="text-black dark:text-white">
    Adapts to system theme
  </Text>
</View>

// Toggle programmatically
import { useColorScheme } from "nativewind";

function ThemeToggle() {
  const { colorScheme, toggleColorScheme } = useColorScheme();

  return (
    <Pressable onPress={toggleColorScheme} className="p-3">
      <Text className="text-gray-900 dark:text-white">
        Current: {colorScheme}
      </Text>
    </Pressable>
  );
}

Platform-Specific Styles

// Different styles per platform
<View className="p-4 ios:pt-12 android:pt-8">
  <Text className="text-base ios:text-lg android:text-sm">
    Platform-aware text
  </Text>
</View>

Responsive Design

// Responsive breakpoints (useful for tablets/web)
<View className="flex-col md:flex-row gap-4">
  <View className="w-full md:w-1/3">
    <Text>Sidebar</Text>
  </View>
  <View className="w-full md:w-2/3">
    <Text>Main content</Text>
  </View>
</View>

Examples

Example 1: Build a mobile UI with Tailwind

User prompt: "Style a React Native chat app using Tailwind CSS classes."

The agent will create styled components with NativeWind — message bubbles, input bar, avatar groups, and status indicators using utility classes.

Example 2: Add dark mode to existing app

User prompt: "Add dark mode to my Expo app. I want it to follow the system setting."

The agent will set up NativeWind, add dark: variants to existing styles, and configure the color scheme provider.

Guidelines

  • className works on all RN components — View, Text, Image, Pressable, etc.
  • Dark mode with dark: prefix — follows system preference by default
  • active: for press statesactive:scale-95, active:bg-blue-700
  • No StyleSheet needed — Tailwind classes compile to native styles
  • ios: and android: prefixes — platform-specific styles
  • Responsive with md:, lg: — useful for tablets and web
  • Animations require reanimatedanimate- classes need react-native-reanimated
  • Custom values in config — extend tailwind.config.js theme as usual
  • Performance — styles are compiled at build time, not runtime
  • Web compatible — same classes work on web via Expo web