@i316/solar-react-native
v0.1.1
Published
i316: Solar icons as React Native components (react-native-svg).
Maintainers
Readme
@i316/solar-react-native
i316: Solar icons as React Native components, rendered with react-native-svg. 1,454 icons in 6 styles: linear (default), bold, broken, bold-duotone, line-duotone, outline.
Other i316 Solar packages: @i316/solar-react (React web), @i316/solar-vue (Vue 3), @i316/solar-angular (Angular) and @i316/solar-web (plain HTML web component and raw SVGs).
npm install @i316/solar-react-native react-native-svgPeer dependencies: react >= 16.8, react-native-svg >= 13. Install react-native-svg in your app; it is never bundled.
Set up tree-shaking first
Metro (the React Native bundler) does not tree-shake. Without help, import { Bell } from '@i316/solar-react-native/linear' puts every linear icon in your app. Add the bundled Babel plugin, which rewrites those imports to per-icon files at compile time:
// babel.config.js (on Expo, add the same `plugins` line next to babel-preset-expo)
module.exports = {
presets: ['module:@react-native/babel-preset'],
plugins: ['@i316/solar-react-native/babel'],
};Then restart Metro with a clean cache (npx react-native start --reset-cache, or npx expo start -c). The plugin handles named imports from the root and from the style paths. Namespace imports (import * as Icons) can't be rewritten and still pull in the whole barrel.
Usage
// One style: every icon is exported as both `Bell` and `BellIcon`.
import { Bell, AltArrowDownIcon } from '@i316/solar-react-native/linear';
// Any style from the root: <Name><Style>Icon, or <Name>Icon to switch style at runtime.
import { HomeIcon, BellBoldIcon, SolarIconProvider } from '@i316/solar-react-native';
<SolarIconProvider size={20} color="currentColor" strokeWidth={2}>
<Bell title="Notifications" testID="bell" />
<HomeIcon variant={focused ? 'bold' : 'linear'} />
</SolarIconProvider>Props on an icon override the provider. Nested providers override their parent's values.
Props
| Prop | Default | |
|---|---|---|
| size | 24 | width and height |
| color | currentColor | icon color |
| strokeWidth | 1.5 | linear, broken, line-duotone only; ignored by the other styles |
| secondaryColor | color | color of the translucent layer, bold-duotone, line-duotone only |
| secondaryOpacity | as designed | opacity of that layer, bold-duotone, line-duotone only |
| title | none | sets accessible, accessibilityRole="image" and accessibilityLabel |
| variant | linear | <Name>Icon only: which style to render |
All other props pass through to <Svg> (style, testID, onPress, …), and ref is forwarded.
License
Icons: Solar Icon Set by 480 Design (https://github.com/480-Design/Solar-Icon-Set), licensed under CC BY 4.0. i316 modified them: recolored from the original hardcoded hex (#1C274C) to currentColor; reformatted, with some duotone groups and multi-path Bold icons consolidated into fewer paths (no intended visual change); seven icons renamed (e.g. cloud-file is now file-cloud); converted into React, React Native, Vue, Angular and web-component formats.
186 of the icons are not 480 Design's: they are Solar icon extensions by Hakim Saoudi (the @solar-icons project) (https://github.com/saoudi-h/solar-icons), licensed under MIT. LICENSE lists them, and meta.json in the web package marks them "origin": "extension".
i316 code (components, runtime, tooling): MIT, © 2026 rahil316. See LICENSE for both licenses in full.
