Skip to content

EvanBacon/expo-router-top-tabs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@bacons/expo-router-top-tabs

Wraps react-native-collapsible-tab-view and adds support for Expo Router.

Add the package to your npm dependencies

yarn add @bacons/expo-router-top-tabs react-native-reanimated
  • Setup Reanimated in the babel.config.js. See here for more info.

Usage

Example in Layout Route:

// app/(tabs)/_layout.tsx

import { Text, View } from "react-native";
import { TopTabs } from "@bacons/expo-router-top-tabs";

export default function CustomLayout() {
  return (
    <TopTabs screenOptions={{}}>
      <TopTabs.Header>
        <View pointerEvents="none" style={{}}>
          <Text>Header</Text>
        </View>
      </TopTabs.Header>

      <TopTabs.Screen name="index" />
    </TopTabs>
  );
}

Usage in child routes:

// app/(tabs)/index.tsx

import { Animated } from "react-native";
import { useScrollProps } from "@bacons/expo-router-top-tabs";

export default function Screen() {
  const props = useScrollProps();

  return <Animated.ScrollView {...props}></Animated.ScrollView>;
}

About

experimental

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published