File tree Expand file tree Collapse file tree 3 files changed +63
-0
lines changed
Expand file tree Collapse file tree 3 files changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -189,8 +189,12 @@ Function that given `{ focused: boolean }` returns `ImageSource` or `AppleIcon`
189189 component = { Albums }
190190 options = { {
191191 tabBarIcon : () => require (' person.png' ),
192+ // SVG is also supported
193+ tabBarIcon : () => require (' person.svg' ),
192194 // or
193195 tabBarIcon : () => ({ sfSymbol: ' person' }),
196+ // You can also pass a URL
197+ tabBarIcon : () => ({ uri: ' https://example.com/icon.png' }),
194198 }}
195199/>
196200```
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ import TintColorsExample from './Examples/TintColors';
3333import NativeBottomTabsVectorIcons from './Examples/NativeBottomTabsVectorIcons' ;
3434import NativeBottomTabsEmbeddedStacks from './Examples/NativeBottomTabsEmbeddedStacks' ;
3535import NativeBottomTabsSVGs from './Examples/NativeBottomTabsSVGs' ;
36+ import NativeBottomTabsRemoteIcons from './Examples/NativeBottomTabsRemoteIcons' ;
3637
3738const FourTabsIgnoreSafeArea = ( ) => {
3839 return < FourTabs ignoresTopSafeArea /> ;
@@ -131,6 +132,10 @@ const examples = [
131132 component : NativeBottomTabsSVGs ,
132133 name : 'Native Bottom Tabs with SVG Icons' ,
133134 } ,
135+ {
136+ component : NativeBottomTabsRemoteIcons ,
137+ name : 'Native Bottom Tabs with SVG Remote Icons' ,
138+ } ,
134139 { component : NativeBottomTabs , name : 'Native Bottom Tabs' } ,
135140 { component : JSBottomTabs , name : 'JS Bottom Tabs' } ,
136141 {
Original file line number Diff line number Diff line change 1+ import { Article } from '../Screens/Article' ;
2+ import { Albums } from '../Screens/Albums' ;
3+ import { Contacts } from '../Screens/Contacts' ;
4+ import { Chat } from '../Screens/Chat' ;
5+ // This import works properly when library is published
6+ import createNativeBottomTabNavigator from '../../../src/react-navigation/navigators/createNativeBottomTabNavigator' ;
7+
8+ const Tab = createNativeBottomTabNavigator ( ) ;
9+
10+ function NativeBottomTabsRemoteIcons ( ) {
11+ return (
12+ < Tab . Navigator labeled >
13+ < Tab . Screen
14+ name = "Article"
15+ component = { Article }
16+ options = { {
17+ tabBarBadge : '10' ,
18+ tabBarIcon : ( ) => ( {
19+ uri : 'https://www.svgrepo.com/show/533824/water-container.svg' ,
20+ } ) ,
21+ } }
22+ />
23+ < Tab . Screen
24+ name = "Albums"
25+ component = { Albums }
26+ options = { {
27+ tabBarIcon : ( ) => ( {
28+ uri : 'https://www.svgrepo.com/show/533813/hat-chef.svg' ,
29+ } ) ,
30+ } }
31+ />
32+ < Tab . Screen
33+ name = "Contacts"
34+ component = { Contacts }
35+ options = { {
36+ tabBarIcon : ( ) => ( {
37+ uri : 'https://www.svgrepo.com/show/533826/shop.svg' ,
38+ } ) ,
39+ } }
40+ />
41+ < Tab . Screen
42+ name = "Chat"
43+ component = { Chat }
44+ options = { {
45+ tabBarIcon : ( ) => ( {
46+ uri : 'https://www.svgrepo.com/show/533828/cheese.svg' ,
47+ } ) ,
48+ } }
49+ />
50+ </ Tab . Navigator >
51+ ) ;
52+ }
53+
54+ export default NativeBottomTabsRemoteIcons ;
You can’t perform that action at this time.
0 commit comments