@jiesu12/react-tab
TypeScript icon, indicating that this package has built-in type declarations

1.9.0 • Public • Published

React Tabs

Let Tabs Control What Tab Should Be Active

const TABS: Tab[] = [
  {
    title: 'Tab one',
    component: <div />,
    rerender: false,
  },
  {
    title: 'Tab two',
    component: <div />,
    rerender: false,
  },
]
<Tabs tabs={TABS} />

Let Parent Control What Tab Should Be Active

const TABS: Tab[] = [
  {
    title: 'Tab one',
    component: <div />,
    rerender: false,
  },
  {
    title: 'Tab two',
    component: <div />,
    rerender: false,
  },
]
const [activeTabTitle, setActiveTabTitle] = useState<string>('Tab one')
<Tabs
  tabs={TABS}
  currentTitle={activeTabTitle}
  setCurrentTitle={(title) => setActiveTabTitle(title)}
/>

Release

  • run npm login if not logged in yet.
  • Update version in package.json
  • run npm run build
  • run npm publish --access public

Readme

Keywords

Package Sidebar

Install

npm i @jiesu12/react-tab

Weekly Downloads

1

Version

1.9.0

License

ISC

Unpacked Size

12.5 kB

Total Files

12

Last publish

Collaborators

  • jiesu12