You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-native-unified-icons

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-unified-icons

A unified interface for various icon sets in React Native

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
185
-35.99%
Maintainers
0
Weekly downloads
 
Created
Source

React Native Unified Icons

A unified interface for various icon sets in React Native, leveraging @expo/vector-icons (which internally uses react-native-vector-icons). This package provides type-safe icon selection across multiple icon libraries with a clean, consistent API.

Installation

npm install react-native-unified-icons
# or
yarn add react-native-unified-icons

Prerequisites

This package requires the following peer dependencies:

  • react
  • react-native
  • @expo/vector-icons

Note: @expo/vector-icons internally uses react-native-vector-icons, so you'll get all the benefits of both libraries.

Usage

Basic Usage

import { Icon } from 'react-native-unified-icons';

// Using AntDesign icons
<Icon
  select={{
    from: "antdesign",
    name: "stepforward"
  }}
  size={24}
  color="black"
/>

// Using Material icons
<Icon
  select={{
    from: "material-icons",
    name: "access-alarm"
  }}
  size={24}
  color="red"
/>

With NativeWind

If you're using NativeWind for styling, you can utilize Tailwind classes for colors and other styles. This is particularly useful when working with custom themes:

// Basic NativeWind usage
<Icon
  select={{
    from: "antdesign",
    name: "heart"
  }}
  className="!text-primary"  // Using your theme's primary color
  size={24}
/>

// Using important modifier for style precedence
<Icon
  select={{
    from: "material-icons",
    name: "favorite"
  }}
  className="!text-secondary"  // Forces the secondary color
  size={24}
/>

// Complex styling example
<Icon
  select={{
    from: "ionicons",
    name: "notifications"
  }}
  className="text-warning dark:text-warning-dark !font-bold"
  size={24}
/>

Supported Props

PropTypeRequiredDescriptionExample
select.fromIconTypeYesThe icon library to use. Options: 'antdesign', 'material-icons', 'ionicons', 'feather', 'evilicons', 'entypo', 'fontawesome6'from: "antdesign"
select.nameIconNameType<T>YesThe name of the icon from the selected library. Type-safe based on the chosen library.name: "stepforward"
sizenumberNoThe size of the icon in pixels.size={24}
colorstringNoThe color of the icon. Can be any valid color string.color="red"
classNamestringNoNativeWind classes for styling (if using NativeWind).className="text-primary"
styleStyleProp<TextStyle>NoAdditional React Native styles.style={{ marginRight: 10 }}

All other TextProps from React Native's Text component are also supported, except for 'children'.

Supported Icon Libraries

This package provides access to all icon sets available in @expo/vector-icons:

LibraryImport KeyExample UsageDescription
AntDesignantdesignfrom: "antdesign"Clean and modern icons from Ant Design
Material Iconsmaterial-iconsfrom: "material-icons"Google's Material Design icons
Ioniconsioniconsfrom: "ionicons"Premium icons for iOS, Android & Web
Featherfeatherfrom: "feather"Simply beautiful open source icons
EvilIconseviliconsfrom: "evilicons"Simple and clean icon set
Entypoentypofrom: "entypo"Over 250 carefully crafted premium icons
FontAwesome 6fontawesome6from: "fontawesome6"Latest version of FontAwesome icons
FontAwesome 5fontawesome5from: "fontawesome5"FontAwesome 5 icon set
FontAwesomefontawesomefrom: "fontawesome"Original FontAwesome icon set
Fontistofontiscofrom: "fontisco"The iconic font and CSS toolkit
Foundationfoundationfrom: "foundation"Iconic fonts for Foundation Framework
Octiconsocticonsfrom: "octicons"GitHub's icon set
Simple Line Iconssimple-line-iconsfrom: "simple-line-icons"Simple and elegant line icons
Zocialzocialfrom: "zocial"Social and brand icons

TypeScript Support

The package is written in TypeScript and provides full type safety. The icon names are typed based on the selected library, providing autocomplete and type checking in supported IDEs.

// This will show type errors if the icon name doesn't exist in the selected library
<Icon
  select={{
    from: "antdesign",
    name: "invalid-icon-name", // TypeScript error
  }}
/>

License

MIT

Keywords

react-native

FAQs

Package last updated on 13 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.