Installation
This guide covers installing UI Kitten into an existing React Native application. If you want to start a new project, check out the Quick Start guide.Prerequisites
Before installing UI Kitten, ensure you have:- Node.js (version 12 or higher)
- React Native development environment set up
- An existing React Native project (version 0.60 or higher recommended)
UI Kitten requires React Native 0.60 or higher. The library is tested with React Native 0.70.6.
Install Packages
UI Kitten requires three packages to be installed:- @ui-kitten/components - The core UI components library
- @eva-design/eva - Eva Design System themes and design tokens
- react-native-svg - Required peer dependency for rendering icons and graphics
- npm
- yarn
- Expo
Package Details
- @ui-kitten/components (v5.3.1): Contains all UI components, theming system, and styling utilities
- @eva-design/eva (v2.2.0): Provides light and dark themes based on Eva Design System
- react-native-svg: Enables SVG support for icons and graphics (peer dependency)
Platform-Specific Setup
iOS Setup (Non-Expo)
For non-Expo React Native projects on iOS, you need to install native dependencies using CocoaPods:react-native-svg native module to your iOS project.
Android Setup
For Android, auto-linking (available in React Native 0.60+) handles the native module linking automatically. No additional steps are required.Expo Web Configuration
If you’re using Expo for Web, you need to configure Babel to properly transpile UI Kitten components:- Open your
app.jsonfile - Add the following configuration under the
"web"key:
Restart the Bundler
After installing the packages, restart your React Native bundler with cache reset:Configure Application Root
To use UI Kitten components, wrap your application root withApplicationProvider:
Import required modules
Open your
App.js or App.tsx file and import UI Kitten and Eva Design System:Wrap your app with ApplicationProvider
Wrap your root component with The
ApplicationProvider and pass the Eva theme:ApplicationProvider component:- Provides theme context to all child components
- Processes Eva Design System styles
- Enables runtime theme switching
- Must be rendered only once at the root level
Complete Setup Example
Here’s a complete example ofApp.js with UI Kitten configured:
Optional: Install Icon Package
To use Eva Icons with UI Kitten components, install the icons package:- npm
- yarn
Optional: Install Date Utilities
If you plan to use Calendar or Datepicker components, install one of the date utility packages:- Moment.js
- date-fns
Verify Installation
To verify that UI Kitten is installed correctly:-
Start your development server:
- You should see your app render without errors
-
Try adding a UI Kitten component like
Buttonto confirm everything works:
Troubleshooting
Module not found: @ui-kitten/components
Module not found: @ui-kitten/components
- Ensure packages are installed:
npm installoryarn install - Clear the Metro bundler cache:
npm start -- --reset-cache - Delete
node_modulesand reinstall:rm -rf node_modules && npm install
react-native-svg errors on iOS
react-native-svg errors on iOS
- Run
cd ios && pod install && cd .. - Clean the build:
cd ios && xcodebuild clean && cd .. - Rebuild the app from Xcode
Expo Web build fails
Expo Web build fails
- Add
@ui-kitten/componentsto Babel include inapp.json - Clear Expo cache:
expo start -c
Types not found (TypeScript)
Types not found (TypeScript)
- UI Kitten has built-in TypeScript definitions
- Ensure TypeScript version is 4.8.3 or compatible
- Restart your TypeScript server / IDE
Next Steps
Quick Start Guide
Build your first UI Kitten app with step-by-step instructions
Theming
Learn how to customize themes and brand your application
Components
Explore all 30+ available UI components
Eva Icons
Learn more about using icons in your app
