Installation
RN Base Components is a comprehensive collection of reusable, customizable, and accessible React Native components built with modern best practices and seamless theme integration.
Package Manager
npm
💻Bash
npm install rn-base-component
yarn
💻Bash
yarn add rn-base-component
pnpm
💻Bash
pnpm add rn-base-component
Quick Start
After installation, you can start using the components immediately:
⚛️TSX
import React from 'react'
import { Button, Card, TextInput } from 'rn-base-component'
export default function App() {
return (
)
}
Theme Setup
For optimal integration, wrap your app with the BaseProvider:
⚛️TSX
import { BaseProvider } from 'rn-base-component'
const theme = {
colors: {
primary: '#007AFF',
secondary: '#5856D6',
cardBackground: '#FFFFFF',
textColor: '#333333',
},
spacing: {
small: 8,
medium: 16,
large: 24,
},
borderRadius: 8,
}
export default function App() {
return (
{/* Your app components */}
)
}
Requirements
- React Native >= 0.64
- React >= 17.0
- TypeScript (recommended)
Optional Dependencies
Some components require additional peer dependencies:
For Gesture Components (Slider)
💻Bash
npm install react-native-gesture-handler react-native-reanimated
For Vector Icons
💻Bash
npm install react-native-vector-icons
Platform Setup
Make sure to complete the platform-specific setup for any additional dependencies following their official documentation.
Verification
To verify the installation, try importing and using a basic component:
⚛️TSX
import { Text } from 'rn-base-component'
function TestComponent() {
return Hello from RN Base Components!
}
If the component renders without errors, you're ready to start building with RN Base Components!
Next Steps
- Explore the component documentation to learn about available components
- Check out examples to see components in action
- Read about theming to customize the appearance