React Native Reusables Documentation
repository·main·Indexed 27 days ago
https://github.com/founded-labs/react-native-reusablesA collection of open-source UI components for React Native inspired by shadcn/ui and built with Nativewind. Includes a CLI for initializing projects, adding components (such as accordion, button, and dialog), and diagnosing project setup via the doctor command. Supports Nativewind and Uniwind styling libraries.
What's inside React Native Reusables
- React Native Reusables brings the shadcn/ui experience to React Native. It provides beautifully crafted, open-source components built with Nativewind. The goal is to offer a component library that is as easy to use and customizable as shadcn/ui, but optimized for React Native environments.
Explore Community Components & Libraries
mainReact Native Reusables has a collection of community-created components and libraries that extend its functionality or fill gaps in the shadcn/ui ecosystem. These resources include specialized tools for calendars, charts, forms, and more.Understand the Text inheritance system
mainBecause React Native child components do not automatically inherit styles from parents, the
Textcomponent utilizesTextClassContext.When a parent component (such as a
Button) wraps its content with this context, theTextcomponent automatically consumes and applies those styles. This ensures that text styling remains consistent with the parent's visual state.Understand the React Native Reusables approach
mainReact Native Reusables is not a traditional component library. Instead, it provides the patterns, structure, and styling conventions to help you build your own component library. It brings theshadcn/uiexperience to React Native by using familiar tools and consistent naming conventions, allowing you to create universal apps with your preferred design system.Install the React Native Reusables CLI
mainYou can run the CLI directly using your preferred package manager without a permanent installation. Use the following commands to execute CLI commands:
npx @react-native-reusables/cli@latest <command> pnpm dlx @react-native-reusables/cli@latest <command> yarn dlx @react-native-reusables/cli@latest <command> bunx --bun @react-native-reusables/cli@latest <command>Install the Sign up form via CLI
mainYou can add the
SignUpFormblock to your project using the React Native Reusables CLI. Depending on your authentication provider, use one of the following commands:Standard (No integration)
Use this if you are implementing your own authentication logic:
npx @react-native-reusables/cli add sign-up-formClerk Integration
Use this if you are using Clerk for authentication:
npx @react-native-reusables/cli add sign-up-form-clerkNote: If using Clerk, ensure you have followed the Clerk Expo quick start to configure your API keys before using the component.
Initialize a new React Native Reusables project
mainTo start a new project from scratch in your current directory, use theinitcommand via the React Native Reusables CLI.Install Social Connections manually (Clerk)
mainTo manually install the Social Connections block integrated with Clerk, follow these steps:
- Install the required Expo dependencies:
npx expo install expo-auth-session expo-web-browser - Install the Clerk package if you haven't already:
npx expo install @clerk/expo - Configure your app for Clerk by following the Clerk Expo quick start.
- Ensure you have the
Buttoncomponent installed. - Copy the Clerk-specific block code into your project.
- Update import paths and address any
// TODO:comments with your app-specific logic.
npx expo install expo-auth-session expo-web-browser npx expo install @clerk/expo- Install the required Expo dependencies:
Install the Reset password form via CLI
mainYou can add the
ResetPasswordFormblock to your project using the React Native Reusables CLI. Choose the command based on whether you are using Clerk for authentication.For standard integration (no Clerk):
add reset-password-formFor Clerk integration:
add reset-password-form-clerkAfter running the command, import the component into your screen. It is recommended to wrap it in a
ScrollViewwithkeyboardShouldPersistTaps="handled"for a better user experience.import { ResetPasswordForm } from '@/components/reset-password-form'; import { ScrollView, View } from 'react-native'; export default function ResetPasswordScreen() { return ( <ScrollView keyboardShouldPersistTaps="handled" contentContainerClassName="sm:flex-1 items-center justify-center p-4 py-8 sm:py-4 sm:p-6 mt-safe" keyboardDismissMode="interactive"> <View className="w-full max-w-sm"> <ResetPasswordForm /> </View> </ScrollView> ); }Install the Accordion component via CLI
mainUse the React Native Reusables CLI to automatically add the Accordion component to your project.
After running the command, you must update your
tailwind.config.jsto include the required accordion animations.Install the Context Menu component
mainYou can install the Context Menu component using the React Native Reusables CLI or manually.
Using the CLI
Run the following command to add the component to your project:
add context-menuManual Installation
- Install the core dependency:
npx expo install @rn-primitives/context-menu - Copy the required UI component files (
text.tsx,icon.tsx, andcontext-menu.tsx) into your project's component directory. - Update the import paths within those files to match your project's structure.
npx expo install @rn-primitives/context-menu- Install the core dependency:
Install Alert Dialog manually
mainTo install the Alert Dialog component manually, first install the required primitive dependency using Expo, then copy the component source files into your project.
npx expo install @rn-primitives/alert-dialog