Nativebase: how to use Tabs of native base ?

Created on 8 Aug 2016  Â·  12Comments  Â·  Source: GeekyAnts/NativeBase

I used the code given in the docs .

import React, { Component } from 'react';
import { Container, Content, Tabs } from 'native-base';

import TabOne from "./tabOne";
import TabTwo from "./tabTwo";
​
http://nativebase.io/docs/v0.5.2/components#tabs

It is showing error : Unable to resolve module ./tabOne.

Most helpful comment

I think it is not very specific in the documentation how to create an actual tab to import and use it in the Tabs component. How does a Tab looks like? I can't find out where it is documented.

All 12 comments

@rajatgupta1993 That is example snippet for tabs
tabOne and tabTwo are two different js files that should be existing in your app

@SupriyaKalghatgi thanks .

but how can I style it?
as in which properties can be changed and how?

@rajatgupta1993 Check the documentation for same

Hi I have tried using this ,
But it is not changing the style of tabs .

<Content> <Tabs tabBgColor="black" tabTextColor="white"> <TabOne tabBgColor="black" tabTextColor="white" tabLabel="One" /> <TabTwo tabLabel="Two" /> </Tabs> </Content>

I have the tried "tabBgColor="black", tabTextColor="white" properties in both , but result is not reflecting.

These are not props and you need to change these variables in your theme.js file. Please go through the docs again. Closing this as this is not an issue.

where is theme.js located?
I couldn't find it .
and please tell me where is this documented?
@sankhadeeproy007

I think it is not very specific in the documentation how to create an actual tab to import and use it in the Tabs component. How does a Tab looks like? I can't find out where it is documented.

Unable to locate /node_modules/native-base/Components/Themes/light.js

Is it possible to know which is the currently active tab?

You can get by initialPage property

  <Tabs initialPage=1}}>




@chibeepatag you can get it from the onChangeTab function

Was this page helpful?
0 / 5 - 0 ratings