hire-tabs
TypeScript icon, indicating that this package has built-in type declarations

2.0.5 • Public • Published

Hire Tabs

Tabs. You know and love.

Example

import React, { Component } from 'react';
import { Tabs, Tab } from 'hire-tabs';
import history from './history';
import { SomeComponent, SomeOtherComponents } from 'some-component-collection';
 
class MyTabbedComponent extends Component {
    // Catch tab change. For example: to alter the history.
    handleTabChange = (label, /* index */) => {
        const path = `/some-route/${label}`;
        history.push(path);
    }
 
    render() {
        return (
            <Tabs
                activeTab="first-tab"
                onChange={this.handleTabChange}>
                <Tab label="First Tab">
                    <SomeComponent />
                </Tab>
                <Tab label="Second Tab">
                    <SomeOtherComponent />
                </Tab>
            </Tabs>
        );
    }
}

Readme

Keywords

Package Sidebar

Install

npm i hire-tabs

Weekly Downloads

2

Version

2.0.5

License

ISC

Unpacked Size

8.32 kB

Total Files

14

Last publish

Collaborators

  • gijsjan