Lucide Icons for React Native
lucide-react-native is the official React Native implementation of the Lucide icon library. It provides a comprehensive collection of highly customizable SVG icons specifically designed for use in mobile applications. The library is currently at version 1.8.0, reflecting a stable and mature codebase since its V1 release. It maintains a consistent and relatively fast release cadence, with minor versions often published weekly or bi-weekly, primarily to introduce new icons and deliver minor fixes across the broader Lucide ecosystem. Key differentiators include its extensive and continually expanding icon set, its lightweight nature, full TypeScript support, and the ability to customize icon properties such as size, color, and stroke width directly as component props. It serves as a modern, community-driven alternative to older icon sets, offering enhanced flexibility, tree-shaking capabilities, and a consistent design language well-suited for contemporary React Native projects.
Common errors
-
Invariant Violation: requireNativeComponent: "RNSVGPath" was not found in the UIManager.
cause The `react-native-svg` library, which is a peer dependency, is not correctly installed, linked, or initialized in the native project.fixInstall `react-native-svg` (`npm install react-native-svg` or `yarn add react-native-svg`). For iOS, navigate to your `ios` directory and run `pod install`. Restart your Metro bundler and re-build your native application. -
TypeError: (0, _lucide_react_native__WEBPACK_IMPORTED_MODULE_2__.Activity) is not a function
cause This error typically indicates an incorrect import statement, where a named export is being treated as a default export, or a CommonJS `require` call is failing to resolve the ES Module exports.fixEnsure you are using named ES module imports: `import { Activity } from 'lucide-react-native';`. Double-check for typos in icon names or extra curly braces. -
Icons not visible or appear as empty squares in Android/iOS.
cause This usually points to a problem with `react-native-svg` not being linked or configured correctly, preventing the SVG assets from rendering.fixVerify that `react-native-svg` is installed and properly linked (especially after React Native upgrades or changing build environments). Clear Metro cache (`npm start -- --reset-cache`) and rebuild your application.
Warnings
- breaking The `lucide-react-native` package depends heavily on `react-native-svg` as a peer dependency. Failure to install and properly link `react-native-svg` will result in runtime errors and icons not rendering.
- gotcha Like other modern React Native packages, `lucide-react-native` is designed for ESM (ECMAScript Modules). Using CommonJS `require()` statements for importing icons can lead to module resolution issues or incorrect bundling.
- gotcha Prior to version 1.1.0, some module resolution issues related to `preserveModulesRoot` could occur in specific bundler configurations, potentially leading to build failures or incorrect imports.
Install
-
npm install lucide-react-native -
yarn add lucide-react-native -
pnpm add lucide-react-native
Imports
- Activity
const Activity = require('lucide-react-native').Activity;import { Activity } from 'lucide-react-native'; - Bell
import Bell from 'lucide-react-native/Bell';
import { Bell } from 'lucide-react-native'; - LucideIcon
import { LucideIcon } from 'lucide-react-native';import type { LucideIcon } from 'lucide-react-native';
Quickstart
import React from 'react';
import { SafeAreaView, Text, StyleSheet } from 'react-native';
import { Activity, Bell, Settings } from 'lucide-react-native';
// Ensure react-native-svg is installed and linked correctly.
// For bare React Native projects, run: npm install react-native-svg && cd ios && pod install
const App = () => {
return (
<SafeAreaView style={styles.container}>
<Text style={styles.title}>Lucide React Native Icons</Text>
<Activity color="#007bff" size={48} strokeWidth={2.5} style={styles.icon} />
<Bell color="crimson" size={36} fill="rgba(220, 20, 60, 0.2)" style={styles.icon} />
<Settings color="green" size={50} style={styles.icon} />
<Text style={styles.description}>These icons are fully customizable SVG components.</Text>
</SafeAreaView>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#f0f4f8',
padding: 20,
},
title: {
fontSize: 24,
fontWeight: 'bold',
marginBottom: 30,
color: '#333',
},
icon: {
marginVertical: 15,
},
description: {
marginTop: 30,
fontSize: 16,
color: '#555',
textAlign: 'center'
}
});
export default App;