• Stars
    star
    179
  • Rank 214,039 (Top 5 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 4 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Smooth and fast cross platform Material Design Tabs for React Native Paper

react-native-paper-tabs


  • Smooth and fast cross platform Material Design Tabs for (react-native-paper)
  • Tested on Android, iOS and the web
  • Simple API
  • Typesafe
  • Scrollable and fixed
  • Leading or top icon
  • Performant
  • Uses native components (react-native-viewpager)
  • Great React Native Web support
  • Implements official spec (material-design-spec)

Demo of react-native-paper-tabs

View video on YouTube

Web demo: reactnativepapertabs.com

About us

We want developers to be able to build software faster using modern tools like GraphQL, Golang and React Native.

Give us a follow on Twitter: RichardLindhout, web_ridge

Donate

Please contribute or donate so we can spend more time on this library.

Donate with PayPal

Getting started

Yarn

yarn add react-native-paper-tabs react-native-pager-view

npm

npm install react-native-paper-tabs react-native-pager-view

Usage

import {
  Button,
  Title,
  Paragraph,
} from 'react-native-paper';
import {
  Tabs,
  TabScreen,
  useTabIndex,
  useTabNavigation,
} from 'react-native-paper-tabs';

function Example() {
    return (
      <Tabs
        // defaultIndex={0} // default = 0
        // uppercase={false} // true/false | default=true | labels are uppercase
        // showTextLabel={false} // true/false | default=false (KEEP PROVIDING LABEL WE USE IT AS KEY INTERNALLY + SCREEN READERS)
        // iconPosition // leading, top | default=leading
        // style={{ backgroundColor:'#fff' }} // works the same as AppBar in react-native-paper
        // dark={false} // works the same as AppBar in react-native-paper
        // theme={} // works the same as AppBar in react-native-paper
        // mode="scrollable" // fixed, scrollable | default=fixed
        // onChangeIndex={(newIndex) => {}} // react on index change
        // showLeadingSpace={true} //  (default=true) show leading space in scrollable tabs inside the header
        // disableSwipe={false} // (default=false) disable swipe to left/right gestures
      >
        <TabScreen label="Explore" icon="compass">
           <ExploreWitHookExamples />
        </TabScreen>
        <TabScreen label="Flights" icon="airplane" disabled>
          <View style={{ backgroundColor: 'black', flex:1 }} />
        </TabScreen>
        <TabScreen
          label="Trips"
          icon="bag-suitcase"
          // optional props
          // onPressIn={() => {
          //   console.log('onPressIn explore');
          // }}
          // onPress={() => {
          //   console.log('onPress explore');
          // }}
        >
           <View style={{ backgroundColor: 'red', flex:1 }} />
        </TabScreen>
      </Tabs>
    )
}

function ExploreWitHookExamples() {
  const goTo = useTabNavigation();
  const index = useTabIndex();
  return (
    <View style={{ flex:1 }}>
      <Title>Explore</Title>
      <Paragraph>Index: {index}</Paragraph>
      <Button onPress={() => goTo(1)}>Go to Flights</Button>
    </View>
  );
}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Checkout our other libraries

More Repositories

1

react-native-paper-dates

Smooth and fast cross platform Material Design date and time picker for React Native Paper
TypeScript
607
star
2

react-ridge-state

Simple πŸ’ͺ fast ⚑️ and small 🎈 (400 bytes) global state management for React (Native)
TypeScript
223
star
3

react-native-ridge-navigation

Simple, performant & type-safe cross platform navigation in React Native / React Native Web
TypeScript
107
star
4

react-native-use-form

Simple form library for React Native with great UX for developer and end-user
TypeScript
81
star
5

gqlgen-sqlboiler

This is a plugin for gqlgen to generate converts + filter queries and resolvers for sqlboiler
Go
74
star
6

react-ridge-translations

Simple πŸ’ͺ fast ⚑️ and small 🎈 (400 bytes) translation library for React / React Native
TypeScript
65
star
7

create-react-native-web-application

A simple starting point for creating iOS, Android en webapp in 1 codebase with React Native (Web)
JavaScript
41
star
8

react-native-paper-autocomplete

The autocomplete package you wished for on all platforms (iOS, Android, web)
TypeScript
17
star
9

react-native-web-hover

Some enhanced elements for react-native-web to support hover on the web.
TypeScript
16
star
10

contact-tracing

A privacy-first contact tracing solution for Android and iOS where users have full control over their data without the Google or Apple Contact Tracing API's
TypeScript
13
star
11

react-native-ridge-list

FlatList abstraction which uses react-window on the web to create better list performance
TypeScript
9
star
12

gqlgen-sqlboiler-examples

Examples of https://github.com/web-ridge/gqlgen-sqlboiler
Go
8
star
13

sqlboiler-graphql-schema

MOVED TO https://github.com/web-ridge/gqlgen-sqlboiler
Go
7
star
14

email-reply-parser

Parses a plain text email and returns it without signatures and other things
Go
6
star
15

detox-web

Abstraction on top of puppeteer to support Detox test to run on the web platform
Java
4
star
16

dbifier

Aims to create a tool to which is easy to use to model your database
TypeScript
3
star
17

utils-go

Go
2
star
18

rem-to-px

rem-to-px cli program which you can put in your package.json. It replaces rem with px.
JavaScript
2
star
19

ridgecontent

[Future plans] Modern CMS system and very simple for end-user and developer
1
star
20

graphql-schema-react-native-app

The goal for this repository is to generate a fully working CRUD app based on an graphql schema with using Relay.dev (experimental)
1
star