npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-tab-strip

v1.0.7

Published

An animated tab bar component for React Native.

Downloads

49

Readme

react-native-tab-strip

npm

Monthly Downloads

An animated tab bar component for React Native.

Getting started

Install the library using your package manager:

pnpm:

pnpm install --save react-native-tab-strip

yarn:

yarn add react-native-tab-strip

npm:

npm install --save react-native-tab-strip

Image Demo Here's a quick demo of react-native-tab-strip:

Android vs iOS

react-native-tab-strip is a versatile and animated tab bar component designed for React Native applications. It provides an intuitive interface for navigating between tabs with customizable styles and smooth

animations.

Key Features Animated Tab Bar: Enhance user experience with smooth animations when switching tabs.

Customizable: Tailor the appearance of the tab bar to fit your app's design using various styling options. Event Handling: Easily manage tab press events with a simple callback function.

Flexible Integration: Integrate seamlessly into new or existing React Native projects.

Usage Example

import AnimatedTabBar from "react-native-tab-strip";

Usage

Start by importing the library:

Use AnimatedTabBar to render a Tab bar .

Programmatically changing selected index

import AnimatedTabBar from "react-native-tab-strip";

return (
  <AnimatedTabBar
    // required
    data={[{ title: "Tab 1" }, { title: "Tab 2" }]}
    // required
    itemWidth={100}
    onTabPress={(item, index) => {
      console.log(item, "this is item", index);
    }}
  />
);

Data:

The data prop is an array of objects, and each object must contain a mandatory property named title. This title will be displayed on the tab item.

<AnimatedTabBar
  // Required: Array of tab data objects, each containing a 'title' property
  data={data}
  // Callback function invoked when a tab is pressed (Optional)
  onTabPress={(item, index) => {
    console.log(`Pressed tab ${index + 1}: ${item} `);
  }}
  // Width of each tab item (Required)
  itemWidth={170}
  // Background color of the tab bar (Optional)
  tabBarBackground="#ffff"
  // Color of the active tab item (Optional)
  tabBarActiveItemColor="#f1f1f1"
  // Color of inactive tab items (Optional)
  tabBarInactiveItemColor="white"
  // Text color of active tab items (Optional)
  tabBarActiveTxtColor="black"
  // Text color of inactive tab items (Optional)
  tabBarInactiveTxtColor="black"
  // Main container style of the tab bar (Optional)
  mainScrollContainerStyle={{}}
  // Optional styles for the main container of the top bar
  containerStyle={{}}
  // Optional styles for the selected item container
  selectedItemContainerStyle={{}}
  // Optional styles for each tab item container
  itemContainerStyle={{}}
  // Optional text style for the selected tab item
  selectedTxtStyle={{}}
  // Optional text style for each tab item
  txtStyle={{}}
/>

Use code with caution.

Available Props

data

Array of objects defining each tab. Each object must have a title property (string).

| Type | Required | | -------- | -------- | | object[] | Yes |


itemWidth

Width of each tab item.

| Type | Required | | ------ | -------- | | number | Yes |


onTabPress

Callback function invoked when a tab is pressed. Receives the pressed tab data object and its index (zero-based) as arguments.

| Type | Required | | -------- | -------- | | function | No |


tabBarBackground

Background color of the tab bar.

| Type | Required | | ------ | -------- | | string | No |


tabBarActiveItemColor

Color of the active tab item.

| Type | Required | | ------ | -------- | | string | No |


tabBarInactiveItemColor

Color of inactive tab items.

| Type | Required | | ------ | -------- | | string | No |


tabBarActiveTxtColor

Text color of active tab items.

| Type | Required | | ------ | -------- | | string | No |


tabBarInactiveTxtColor

Text color of inactive tab items.

| Type | Required | | ------ | -------- | | string | No |


mainScrollContainerStyle

Style object applied to the main container of the tab bar.

| Type | Required | | ------ | -------- | | object | No |


containerStyle

Style object applied to the container of the selected tab item.

| Type | Required | | ------ | -------- | | object | No |


selectedItemContainerStyle

Style object applied to the container of each tab item.

| Type | Required | | ------ | -------- | | object | No |


itemContainerStyle

Style object applied to the text element of each tab item.

| Type | Required | | ------ | -------- | | object | No |


selectedTxtStyle

Style object applied to the text element of the selected tab item.

| Type | Required | | ------ | -------- | | object | No |


txtStyle

Style object applied to the text element of each tab item.

| Type | Required | | ------ | -------- | | object | No |