$ npm install react-native-tabbed-control --save
...
import TabbedControl from 'react-native-tabbed-control';
const tabs = [{title: 'South Africa'} , {title: 'Zambia'}];
updateIndex(selectedIndex) {
this.setState({selectedIndex: selectedIndex});
}
render() {
return (
<View>
<TabbedControl tabs={tabs} color={'#024b30'} onIndexChange={this.updateIndex}/>
</View>
);
};
...
import TabbedControl from 'react-native-tabbed-control';
const One = () => { return <Text>This is first view</Text>; };
const Two = () => { return <Text>This is second view</Text>; };
const tabs = [
{
title: 'One',
view: One
},
{
title: 'Two',
view: Two
}
];
render() {
return (
<View style={styles.container}>
<TabbedControl tabs={tabs} color={'#024b30'} />
</View>
);
};
Property | Type | isRequired |
---|---|---|
title | String | YES |
view | View | NO |
Property | Type | isRequired |
---|---|---|
tabs | Tab Array | NO |
color | Color | NO |
onIndexChange | Function | NO |
- Star our GitHub repo ⭐
- Create pull requests, submit bugs, suggest new features or documentation updates 🔧
- Follow me on Twitter
- Follow me on Instagram
- Buy me coffee or Donate
- Rona Mobile App - Covid19 Global Pandemic Statistics Tracker
- Luno API Playground - A Swift playground on the Public Luno API.
- VALR API Playground - A Swift playground on the VALR Public API
- DemoProject
- Fin24
MIT license.
Made with ♥ by Manenga. Support me by making a donation.
- onIndexChange when a tab is tapped
- Add icons as tab titles
- Update selected index on scroll