这是indexloc提供的服务,不要输入任何密码
Skip to content

yasuf/react-tab-selector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Tab Selector

Tab Selector React component. Useful when you want to have a tabbed page and you want to display different categories in each tab.

Getting started

  1. Inside your project, run npm install --save react-tab-selector.

  2. Use the component:

import { TabSelector } from 'react-tab-selector';


const MyComponent = () => {
  return <div>
    <TabSelector
      tabs={[
        {
          title: 'All',
          onClick: () => alert('Clicked All')
        },
        {
          title: 'Gaming',
          onClick: () => alert('Clicked Gaming')
        },
        {
          title: 'Photography',
          onClick: () => alert('Clicked Photography')
        }
      ]}
    />
  </div>
}

Component props

Prop Description
tabs Takes an array of objects with the value pairs title and onClick.
For example: [{ title: 'All', onClick: myCallback }]

Visual example

Here's what this example would look like:

TabSelector example

Steps to publish a new version to the NPM registry

  1. Run npm run build.
  2. Verify files have changed with git status.
  3. Run npm publish.

About

React Tab Selector component, clone of the youtube selector

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published