Skip to content

Commit 4261ed6

Browse files
committed
Update Nano Icons docs per review
1 parent c195f01 commit 4261ed6

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎versioned_docs/version-8.x/icons.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -546,15 +546,11 @@ Here `icon_name` is the resource name without the file extension. On Android, th
546546

547547
### [React Native Nano Icons](https://github.com/software-mansion-labs/react-native-nano-icons)
548548

549-
[React Native Nano Icons](https://nano-icons.swmansion.com/) provides a way to use custom SVG files as performant font-based icons, both in JavaScript-based and native navigation components.
549+
[React Native Nano Icons](https://nano-icons.swmansion.com/) provides a way to use custom SVG files as performant font-based icons.
550550

551-
To use it, install the `react-native-nano-icons` package, then set it up depending on where the icons are rendered.
551+
To use it, install the `react-native-nano-icons` package, then follow the [quick start](https://github.com/software-mansion-labs/react-native-nano-icons#-quick-start) to set it up with your SVG icons.
552552

553-
For JavaScript-based components, such as the `custom` [implementation](bottom-tab-navigator.md#implementation) of Bottom Tab Navigator, follow the [quick start](https://github.com/software-mansion-labs/react-native-nano-icons#-quick-start) and use the `Icon` component created with `createNanoIconSet`.
554-
555-
For native components, such as the tab bar with the `native` implementation, follow the [native symbols setup](https://github.com/software-mansion-labs/react-native-nano-icons#-native-symbols) to generate SF Symbols on iOS and vector drawables on Android from your SVG files, and rebuild the app.
556-
557-
Pass the SVG file name to the `nativeNanoSymbol` function to create a type-safe icon. For example, for `newspaper.svg`:
553+
Then you can use the icon by passing the name to the `nativeNanoSymbol` function:
558554

559555
```js
560556
import { nativeNanoSymbol } from 'react-native-nano-icons/symbols';
@@ -564,6 +560,8 @@ import { nativeNanoSymbol } from 'react-native-nano-icons/symbols';
564560
tabBarIcon: nativeNanoSymbol('newspaper'),
565561
```
566562

563+
Here, we use `newspaper` as the icon name, which is the filename `newspaper.svg` without extension.
564+
567565
It returns `{ type: 'sfSymbol', name: 'nano.newspaper' }` on iOS, and `{ type: 'image', source: { uri: 'nano_newspaper' } }` on Android, which resolves to a native vector drawable asset.
568566

569567
The second argument specifies how to color the symbol:
@@ -608,6 +606,8 @@ function MyComponent() {
608606
}
609607
```
610608

609+
For more general usage, the library also provides a font-based `Icon` component, created with [`createNanoIconSet`](https://github.com/software-mansion-labs/react-native-nano-icons#createnanoiconset), to render the icons in your own components.
610+
611611
### [React Native Vector Icons](https://github.com/oblador/react-native-vector-icons)
612612

613613
The React Native Vector Icons library provides various sets of font icons. Font icons cannot be used directly in most native navigation components such as tab bars or headers. But they can be [rasterized into images](https://github.com/oblador/react-native-vector-icons?tab=readme-ov-file#usage-as-png-imagesource-object) and used with the `type: 'image'` option.

0 commit comments

Comments
 (0)