# react-simple-tab

> tab component in React.js

Latest version **1.0.1** (published 2016-06-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-simple-tab
pnpm add react-simple-tab
yarn add react-simple-tab
bun add react-simple-tab
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-06-22 |
| First published | 2015-01-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Rudolph-Miller |
| Maintainers | rudolph-miller |
| Keywords | react, react-component, simple, tab, panel |

## Links

- npm: https://www.npmjs.com/package/react-simple-tab
- Repository: https://github.com/Rudolph-Miller/react-simple-tab
- Homepage: https://github.com/Rudolph-Miller/react-simple-tab#readme
- Issues: https://github.com/Rudolph-Miller/react-simple-tab/issues
- npm.io page: https://npm.io/package/react-simple-tab

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^0.14.7
- [immutable](https://npm.io/package/immutable.md) ^3.4.1

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-06-22
- 1.0.0 — 2016-03-18
- 0.1.0 — 2015-08-24
- 0.0.11 — 2015-01-14
- 0.0.10 — 2015-01-14
- 0.0.9 — 2015-01-14
- 0.0.8 — 2015-01-14
- 0.0.7 — 2015-01-14
- 0.0.6 — 2015-01-08
- 0.0.5 — 2015-01-06
- 0.0.4 — 2015-01-06
- 0.0.3 — 2015-01-05
- 0.0.2 — 2015-01-05
- 0.0.1 — 2015-01-05

## README

# React Simple Tab

[![npm version](https://badge.fury.io/js/react-simple-tab.svg)](http://badge.fury.io/js/react-simple-tab)

# Example

https://rudolph-miller.github.io/react-simple-tab

# Feature

- customizable style

# Install

```sh
npm install react-simple-tab
```

# Usage

```es6
window.React = require('react');
import { render } from 'react-dom';
import React, { Component, PropTypes } from 'react';
import SimpleTab from 'react-simple-tab';

const Styles = {
  tabContent: {
    border: 'solid 2px #ebeced',
    padding: '15px'
  },
  app: {
    tabStyle: {
      fontSize: '20px'
    },
    labelListStyle: {
      margin: 0,
      padding: 0,
      bottom: '-2px',
      position: 'relative'
    },
    tabContentStyle: {
      padding: '10px'
    },
    activeTabContentStyle: {
      borderWidth: '4px 2px 0px 2px',
      borderColor: '#ff6c60 #ebeced transparent #ebeced',
      borderStyle: 'solid',
      zIndex: 1,
      background: 'white',
      fontWeight: 'bold'
    }
  }
};

class TabContent extends Component {
  render() {
    return (
      <div style={Styles.tabContent}>
        {this.props.children}
      </div>
    );
  }
}

class App extends Component {
  render() {
    const tabs = [
      { title: 'Tab 1', content: (<TabContent>Content 1</TabContent>) },
      { title: 'Tab 2', content: (<TabContent>Content 2</TabContent>) },
      { title: 'Tab 3', content: (<TabContent>Content 3</TabContent>) }
    ].map(tab => {
      return Object.assign({}, tab, {
        style: Styles.app.tabContentStyle,
        activeStyle: Styles.app.activeTabContentStyle
      });
    });

    return (
      <SimpleTab
        tabs={tabs}
        style={Styles.app.tabStyle}
        labelListStyle={Styles.app.labelListStyle} />
    );
  }
}

render(<App />, document.getElementById('app'));
```

# PropTypes

- tabs: React.PropTypes.array.isRequired
- style: React.PropTypes.object
- labelListStyle: React.PropTypes.object

# Properties

- tabs: Object
  - title: String
    - tab label title
  - content: React Element
    - tab content
  - style: Object
    - the default style applied to tab label
  - activeStyle: Object
    - the style applied to tab label when the tab is active
- style: Object
  - the style applied to `<div />` wrapping tabs
- listLabelStyle: Object
  - the style applied to `<ul />` wrapping tab labels

# Copyright

Copyright (c) 2015 Rudolph-Miller (chopsticks.tk.ppfm@gmail.com)

# License

Licensed under the MIT License.

---
_Source: https://npm.io/package/react-simple-tab · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
