1.0.5 • Published 5 years ago

@tickid/react-native-tabs v1.0.5

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

Demo

Installation

Yarn:

$ npm i @tickid/react-native-tabs --save

or NPM:

$ yarn add @tickid/react-native-tabs

Usage

Sample code to use this simple library:

import React, { Component } from 'react';
import { Text } from 'react-native';
import { Tabs, Tab } from '@tickid/react-native-tabs';

export default class TabsExample extends Component {
  render() {
    return (
      <Tabs>
        <Tab heading="Tab one">
          <Text>Content of #tabOne</Text>
        </Tab>

        <Tab heading="Tab two">
          <Text>Content of #tabTwo</Text>
        </Tab>

        <Tab heading="Tab three">
          <Text>Content of #tabThree</Text>
        </Tab>
      </Tabs>
    );
  }
}

Props:

<Tabs>

PropertyTypeDefaultDescription
tabIndexNumber0The default tab index is active. (optional)
tabChangeDurationNumber100Slider speed in milliseconds. (optional)
tabTitleStyleStyleStyle applied to tab title. (optional)
activeTabTitleStyleStyleStyle applied to active tab title. (optional)
tabContainerStyleStyleStyle applied to tab container. (optional)
activeTabContainerStyleStyleStyle applied to active tab container. (optional)
tabBodyStyleStyleStyle applied to tab body (Wrap ). (optional)
containerStyleStyleStyle applied to wrap of this library. (optional)
activeLineColorString#355587Specifies the background color for active tab. (optional)
onChangeTabFunctionCalled when the tab change. (optional)

<Tab>

PropertyTypeDefaultDescription
headingStringThe title of the tab. (required)
containerStyleStyleStyles are applied individually to each tab. (optional)