Skip to content

cheetax/react-native-tabs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@cheetax/react-native-tabs

It works using packages [react-native-paper] and [react-native-reanimated]

Install

npm i @cheetax/react-native-tabs

Use

import Tabs from '@cheetax/react-native-tabs';
import { LayoutChangeEvent, StyleSheet, Text, View } from 'react-native';

export default function App() {

  const onLayout = (event: LayoutChangeEvent) => {
    const { width, height } = event.nativeEvent?.layout || { width: 0, height: 0 }
    console.log(`Width: ${width}, Height: ${height}`);
  }
  return (
    <View style={styles.container} onLayout={onLayout}>
      <Tabs content={['Test1', 'Test2', 'Test3r', 'Test1', 'Test1', 'Test1']}
        mode='primary' />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});

Props

Common props you may want to specify include:

  • content - ['Array string'] or ['Array { icon: IconType name: string }']
  • mode - ['primary'] or ['secondary'] Default 'primary'
  • onTabPress - [function] Will call and return index when choosing a tab
  • duration - [number] Animation duration
  • theme - [MD3Theme] MD3Theme from the package [react-native-paper]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published