بنقرة واحدة
rnr-reusables
How to add, manage, and update React Native Reusables (UniWind) components in the rn-uniwind package
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
How to add, manage, and update React Native Reusables (UniWind) components in the rn-uniwind package
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
| name | rnr-reusables |
| description | How to add, manage, and update React Native Reusables (UniWind) components in the rn-uniwind package |
This skill covers how to work with react-native-reusables components using UniWind (Tailwind v4 CSS-first) in this monorepo.
tailwind.config.js is needed.withUniwind from 'uniwind' instead of cssInterop from 'nativewind'.packages/rn-uniwind/
├── components.json # shadcn/ui CLI configuration
├── uniwind-types.d.ts # Required for UniWind detection
├── package.json
├── tsconfig.json
├── src/
│ └── index.ts # Package exports
└── reusables/
├── global.css # Tailwind v4 CSS-first theme
├── lib/
│ └── utils.ts # cn() utility
└── components/
└── ui/ # UI components from the registry
├── button.tsx
├── text.tsx
├── card.tsx
├── badge.tsx
├── dialog.tsx
├── icon.tsx
└── native-only-animated-view.tsx
[!IMPORTANT] The CLI's automatic UniWind detection only works in a full Expo app, not in a standalone library package. You must run the CLI from the
uniwind-expoapp.
cd apps/uniwind-expo
pnpm dlx @react-native-reusables/cli@latest add <component-name>
You should see ℹ Styling Library: Uniwind in the output — this confirms UniWind detection is working.
cp apps/uniwind-expo/components/ui/<component>.tsx packages/rn-uniwind/reusables/components/ui/
@/ but rn-uniwind uses ~/:cd packages/rn-uniwind
find reusables/components/ui -name '*.tsx' -exec sed -i '' "s|from '@/components/|from '~/components/|g; s|from '@/lib/|from '~/lib/|g" {} +
Update src/index.ts to export the new component.
Update package.json if the component needs new dependencies (e.g., @rn-primitives/*).
# From apps/uniwind-expo:
pnpm dlx @react-native-reusables/cli@latest add accordion alert checkbox input label
# To add ALL components at once:
pnpm dlx @react-native-reusables/cli@latest add --all
pnpm dlx @react-native-reusables/cli@latest add --overwrite <component-name>
See the full list at: https://reactnativereusables.com/docs/components/accordion
Common components: accordion, alert, alert-dialog, avatar, badge, button, card, checkbox, collapsible, context-menu, dialog, dropdown-menu, hover-card, input, label, menubar, popover, progress, radio-group, select, separator, skeleton, switch, tabs, text, textarea, toggle, toggle-group, tooltip.
components.json{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "",
"css": "./reusables/global.css",
"baseColor": "neutral",
"cssVariables": true
},
"aliases": {
"components": "~/components",
"utils": "~/lib/utils",
"ui": "~/components/ui",
"lib": "~/lib",
"hooks": "~/hooks"
},
"iconLibrary": "lucide"
}
config: "" — no tailwind.config.js (Tailwind v4 CSS-first)~/ prefix (not @/) for the rn-uniwind packageglobal.css — Tailwind v4 CSS-First ThemeThe theme uses @import "tailwindcss" and @import "uniwind" with @theme blocks and oklch() color values. Do not use the old hsl(var(--xxx)) pattern.
uniwind-types.d.tsThis file is required for the CLI to detect UniWind. It declares the light/dark themes:
/// <reference types="uniwind/types" />
declare module 'uniwind' {
export interface UniwindConfig {
themes: readonly ['light', 'dark']
}
}
export {}
| Feature | UniWind ✅ | NativeWind ❌ |
|---|---|---|
| Icon styling | withUniwind(Component, {...}) | cssInterop(Component, {...}) |
| Import | from 'uniwind' | from 'nativewind' |
| Config | No tailwind.config.js | Requires tailwind.config.js |
| CSS | @import "uniwind" in global.css | @tailwind directives |
| TW version | Tailwind v4 | Tailwind v3 |
If you see cssInterop or nativewind imports in rn-uniwind components, they are wrong — the NativeWind version was installed instead of UniWind.
This happens when running the CLI from packages/rn-uniwind directly. Always run from apps/uniwind-expo and copy files over.
This is a false positive when using Tailwind v4 CSS-first. The CLI checks for tailwind.config.js which doesn't exist in v4 projects. Ignore this warning.
After adding components, run:
grep -r "nativewind" packages/rn-uniwind/reusables/components/ui/
If any results appear, the wrong version was installed.
# Diagnose setup issues
pnpm dlx @react-native-reusables/cli@latest doctor
# Initialize a new UniWind project from scratch
pnpm dlx @react-native-reusables/cli@latest init -t minimal-uniwind
# List available components
pnpm dlx @react-native-reusables/cli@latest add
# (without a component name, shows a multi-select prompt)