0.12.5 • Published 3 years ago

@hiendv/react-tabs v0.12.5

Weekly downloads
9
License
MIT
Repository
github
Last release
3 years ago

@hiendv/react-tabs

Lightweight and flexible tabs component for the web :zap:

Features

  • Tab definition using template & programmatically
  • Octicons support in tab items
  • Beautiful modulized themes included
  • Easily accessible navigation with URL
  • Easy tab positioning
  • Ghost tabs support

Demo

See https://hiendv.github.io/tabs

Installation & Usage

CDN

<script src="https://cdn.jsdelivr.net/npm/@hiendv/react-tabs@latest/dist/iife.js" crossorigin="anonymous"></script>

Note: We recommend linking to a specific version number that you can update manually

const { Tab, Tabs, themeDefault, themeDark } = reacttabs

NPM

npm install --save @hiendv/react-tabs
# yarn add @hiendv/react-tabs
import React, { Component } from 'react'
import { Tabs, Tab } from '@hiendv/react-tabs'
export default class App extends Component {
  render () {
    return (
      <Tabs>
        <Tab title='First'>
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
          tempor incididunt ut labore et dolore magna aliqua.
        </Tab>

        <Tab title='Second'>
          Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
          aliquip ex ea commodo consequat.
        </Tab>

        <Tab title='Third'>
          Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
          dolore eu fugiat nulla pariatur.
        </Tab>
      </Tabs>
    )
  }
}

Please see react-tabs-example for a complete demonstration.

Documentation

Tabs

PropertyTypeRequiredDefaultDescription
themeObjectNothemeDefault - @hiendv/tabsModulized style
showNumberNo0Initial active tab

EventArgumentsDescription
onUpdate(index)Current active tab

Tab

Props

PropertyTypeRequiredDefaultDescription
titleStringNo'Title'Tab title
iconObjectNoEmptyTab octicon - octicons-react
hashStringNonullUnique hash fragment for easy bookmark and navigation
endBooleanNofalsePush the tab and its following friends to the right
ghostBooleanNofalseMark tab as a pure button

Development & Testing

Please check the Contributing Guidelines.

Contribution

Issues and PRs are welcome !

0.12.5

3 years ago

0.3.10

4 years ago

0.3.9

4 years ago

0.3.8

4 years ago

0.3.7

4 years ago

0.3.5

4 years ago

0.3.2

4 years ago

0.3.1

5 years ago

0.3.0

5 years ago