React Native Starter
2.0.0
2.0.0
  • Getting Started
  • Architecture
  • Testing
  • Internationalization
  • Adding Pages and Components
  • Components
    • Text
    • Icon
    • Card
    • List
    • Top Navigation
    • Top Tabs
    • Bottom Tabs
    • Menu
    • Button
    • Checkbox
    • Toggle
    • Input
  • Screens
  • Theming
Powered by GitBook
On this page
  1. Components

Top Tabs

Top Bar provides top navigation.

 import { RadioGroup } from '../components'
 
 <View>
   <RadioGroup
      items={items}
      selectedIndex={tab1State}
      onChange={index => setTab1State(index)}
      underline
    />
    <Text>{items[tab1State]}</Text>
</View>

Tabs also may contain icons, to provide a better user interfaces.

  import { RadioGroup } from '../components'
  
  <View>
   <RadioGroup
      items={[
              <View
                style={{
                  alignItems: 'center',
                  flexDirection: 'row',
                  color: 'inherit',
                }}
              >
                <Text style={{ color: 'inherit' }}>One</Text>
                <Icon name={'staro'} size={20} style={{ marginLeft: 5 }} />
              </View>,
              <View
                style={{
                  alignItems: 'center',
                  flexDirection: 'row',
                  color: 'inherit',
                }}
              >
                <Text>Two</Text>
                <Icon name={'staro'} size={20} style={{ marginLeft: 5 }} />
              </View>,
              <View
                style={{
                  alignItems: 'center',
                  flexDirection: 'row',
                  color: 'inherit',
                }}
              >
                <Text>Three</Text>
                <Icon name={'staro'} size={20} style={{ marginLeft: 5 }} />
              </View>,
            ]}
      selectedIndex={tab1State}
      onChange={index => setTab1State(index)}
      underline
    />
    <Text>{items[tab1State]}</Text>
</View>

PreviousTop NavigationNextBottom Tabs

Last updated 4 years ago