File tree Expand file tree Collapse file tree 3 files changed +6631
-6
lines changed Expand file tree Collapse file tree 3 files changed +6631
-6
lines changed Original file line number Diff line number Diff line change 22title : Icons
33---
44
5+ import TabItem from ' @theme/TabItem' ;
6+ import Tabs from ' @theme/Tabs' ;
57import IconsList from ' @site/src/components/IconsList.tsx' ;
68
79# Icons
@@ -28,10 +30,29 @@ Example:
2830< Button icon= " camera" > Press me< / Button>
2931```
3032
31- <details >
32- <summary >See the list of supported icons</summary >
33- <IconsList />
34- </details >
33+ :::note
34+ Choose the correct tab below based on your ` react-native-vector-icons ` version:
35+
36+ - Use ** latest** tab if you're using the latest version of ` @react-native-vector-icons/material-design-icons `
37+ - Use ** 10.x** tab if you're still using the old single package ` react-native-vector-icons ` , version ` 10.x `
38+
39+ If you are using ` @expo/vector-icons ` , please check their [ searchable list of icons] ( https://icons.expo.fyi/ ) .
40+ :::
41+
42+ <Tabs >
43+ <TabItem value = " material-design-icons" label = " latest" >
44+ <details >
45+ <summary >See the list of supported icons</summary >
46+ <IconsList latest />
47+ </details >
48+ </TabItem >
49+ <TabItem value = " material-community-icons" label = " 10.x" >
50+ <details >
51+ <summary >See the list of supported icons</summary >
52+ <IconsList />
53+ </details >
54+ </TabItem >
55+ </Tabs >
3556
3657### 2. An image source
3758
Original file line number Diff line number Diff line change 11import React , { useState } from 'react' ;
22
3- const icons : { [ key in string ] : number } = {
3+ const latestIcons : { [ key in string ] : number } = {
44 ...require ( '../../node_modules/@react-native-vector-icons/material-design-icons/glyphmaps/MaterialDesignIcons.json' ) ,
55} ;
66
7- export default function IconsList ( ) {
7+ const oldIcons : { [ key in string ] : number } = {
8+ ...require ( '../utils/MaterialCommunityIcons.json' ) ,
9+ } ;
10+
11+ export default function IconsList ( { latest } : { latest ?: boolean } ) {
12+ const icons = latest ? latestIcons : oldIcons ;
13+
814 const [ query , setQuery ] = useState ( '' ) ;
915
1016 const iconNames = Object . keys ( icons ) . filter (
You can’t perform that action at this time.
0 commit comments