Giter Club home page Giter Club logo

react-native-tabbar's Introduction

react-native-tabbar

React-Native Tab bar with more freedom

Introduction

I have decided to remove all the abstraction from this module. Now there is only one component, and that is Tabbar. All the children inside Tabbar component will be rendered inside of it. There are no TabItem, WithIcon or anything else. what you put into Tabbar will be displayed as tabs. By doing that, you can attach it to your favourite state managements such as Redux, or Mobx. This module should be use as a first base block for more sophisticated tabbar. Please take a look at examples folder as I added couple of common usage.

Installation

npm install react-native-tabbar

Methods

name arguments description
hide duration shows the tabbar with animations, default duration is 200 ms
show duration shows the tabbar with animations, default duration is 200 ms
updateHeight scrollY position pass the value of onScroll y position to show or hide tabbar
recalculate none once your orientation changes, call this method to re calculate the correct position of tabbar

Props

name type default value description
height number 50 the height of tabbar
offset number 150 how far you have to scroll before tabbar starts to disappear
step number 0.25 the lower the number the slower the tabbar disappear
show boolean true if you want to not show the tabbar at the start, pass false to this prop
disable boolean false disables the progress show/hide tabbar

examples

  • Tabbar changes based on Orientation

react-native-tabbar's People

Contributors

alinz avatar cmcewen avatar jaysoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-tabbar's Issues

Icons not showing on Android

I've managed to get icons showing on iOS by including ttf file into ios directory and putting it in info.plist
How do I do same with Android?
In android, it show bunch of chinese words instead of Icons!

Uncaught TypeError: glypyMapMaker is not a function

I included "react-native-tabbar": "^0.3.4" into my package.json.
And I run 'npm install'.

And I used following code snippets in my application.

import Tabbar from 'react-native-tabbar';

let glypy = glypyMapMaker({
  Home: 'e900',
  Camera: 'e901',
  Stat: 'e902',
  Settings: 'e903',
  Favorite: 'e904',
});

let {
  Tab,
  RawContent,
  IconWithBar,
  glypyMapMaker
} = Tabbar;


// this block has error of 'undefined' function
let glypy = glypyMapMaker({
  Home: 'e900',
  Camera: 'e901',
  Stat: 'e902',
  Settings: 'e903',
  Favorite: 'e904',
});

But I get error of 'undefined' function.
Looking for your help.
Thanks

Again Styles

I have read closed Issues, But still I can't style the tabbar.
I want a tab bar without a border. and also want to change the color of font when it is selected.
How can I change these parameters?
const color = selected? onActiveColor : onInactiveColor
const barColor = selected? onActiveColorBar : onInactiveColorBar;
const borderWidth = selected? 2 : 1;
const padding = selected? 0 : 1;

Rotate Problem

When I rotate the phone Tabbar would not extend to fill the screen. I attached the screenshot.
rotate

assertion failed

not entirely sure if that's related to tabbar, but when I run it on iOS I get tons of assertion errors when scrolling in the view.. short snipped:

Aug  4 14:15:39 Davids-MacBook-Air routined[29572] <Error>: CoreLocation: Error occurred while trying to retrieve motion state update: CMErrorDomain Code:104
Aug  4 14:15:41 Davids-MacBook-Air assertiond[29587] <Error>: assertion failed: 15A278b 13E230: assertiond + 15801 [3C808658-78EC-3950-A264-79A64E0E463B]: 0x1
Aug  4 14:15:41 Davids-MacBook-Air Unknown[29587] <Error>: 
Aug  4 14:15:41 Davids-MacBook-Air assertiond[29587] <Error>: assertion failed: 15A278b 13E230: assertiond + 15801 [3C808658-78EC-3950-A264-79A64E0E463B]: 0x1
Aug  4 14:15:41 Davids-MacBook-Air Unknown[29587] <Error>: 

Trying to add unknown view tag: 8

I started playing around with this component but couldn't get it running on Android. Here is my render() function:

render: function() {
    var state = this.state;
    return (
      <Tabbar
        selected={state.selectedTab}
        onTabItemPress={this.onTabItemPress}
      >
        <Tabbar.Item name="shop">
          <Tabbar.Item.Content>
            <View style={{ flex: 1, backgroundColor: 'blue' }}>Asd</View>
          </Tabbar.Item.Content>
          <Tabbar.Item.Icon>
            <Text>Icon1</Text>
          </Tabbar.Item.Icon>
        </Tabbar.Item>
      </Tabbar>
    );
  },

When I try to run this, I get the red screen of death saying Trying to add unknown view tag: 8 detail: View tag:7

how to use?

how to use this tabbar.. I dont seem to find a proper documentation for this.

Trying to add unknown view tag

screen shot 2015-11-24 at 4 11 29 pm
The same code is working perfectly fine iOS though. Also please note that the code which has been commented out also works fine. What might I be doing wrong? Thanks.

How to style the Tabbar and Tabbar.Items?

How can I change things like backgroundColor for the Tabbar and maybe the color of the Icons, depending on wether they are active or not?

EDIT: OK for changing Items based on active state I can simply access this.state.selectedTab, but it remains unclear to me how to change the general Tabbar styles (background color, ect) and the individual Item styles (might want to have a different background color for the selected item).

Android navigation buttons obscuring the tabbar

Hi ,

Just running the SimpleTabbar example on an android emulator.

tabbar

I've looked over the styling, and it's not immediately clear what the problem is. It's a very similar styling setup to react-native-tabs, but the react-native-tabs does not have the animations stuff.

Could fix this by adding a bottom to the styling, but that's not elegant.

I tried this on a few emulators on API platforms 22 and 23. Running Ubuntu 16.04.

Cheers!

Requiring unknown module

Hi, I've installed your module and it is present in my node_modules folder. However when I am trying to require it I have this error message in the appication: Requiring unknown module "react-native-tabbar/jsx/index.js".

Is there something I am missing?

Thanks,
Paul

image

image

How could I make tabs Supptort RTL

I'm creating bilingual android application (English/Arabic)
And I want when user select Arabic language the first tab display in the right side instead of left side
What is the best way to do that?

No update when clicking between two navigator items

If you were to have the following:

Tab1 : Navigator 1 with Component A as initial stack item
Tab2 : Navigator 2 with Component B as initial stack item
Tab3 : Empty View

Clicking between Tabs 1 and 2 will not change the content, but clicking to tab3 then back to either Tab1 or 2 will update the content correctly (albeit it having lost its previous 'state').

How to use a class as the content of a tab?

Hi,
How can I use another class as the content of one of my tabs?
Let's say I have a test.js, and in it I have a text box. Instead of:
content = This is the content 1

I want to use that class to render one of my tabs. Is that possible here?

Thanks for your help in advance.

Custom Icon's text fontSize.

now the text's font size is hard coded as 12,

      <View style={{ paddingTop: 5 }}>
        <Text style={{ fontSize: 12, color: color }}>{label}</Text>
      </View>

I think it's better to add a prop for the text style.

Help: Material design styling

I like what you've done with the new PR. Any chance I could get some help here?

I'm wondering how to do the highlighted line above the selected text...
components_tabs_usage_mobile5

any help would be appreciated

Slow performance on device

I'm getting very slow response times testing on a device. Takes a few seconds to switch tabs. Sometimes unresponsive. Need to look into whats causing it but thought I would raise it here. Made sure my bundle is not in dev mode and app is compiled in release mode.

Device is iPhone 4S iOS 7.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.