# react-simply-tabs

> Simple and small react.js tabs component

Latest version **1.0.4** (published 2021-06-11) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install react-simply-tabs
pnpm add react-simply-tabs
yarn add react-simply-tabs
bun add react-simply-tabs
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2021-06-11 |
| First published | 2019-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 11.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Vadym Shymko |
| Maintainers | vadymshymko |
| Keywords | react, react-tabs, tabs, tabs-widget, react-component, reactjs |

## Links

- npm: https://www.npmjs.com/package/react-simply-tabs
- Repository: https://github.com/vadymshymko/react-simply-tabs
- Homepage: https://github.com/vadymshymko/react-simply-tabs#readme
- Issues: https://github.com/vadymshymko/react-simply-tabs/issues
- npm.io page: https://npm.io/package/react-simply-tabs

## Dependencies (3)

- [core-js](https://npm.io/package/core-js.md) ^3.5.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.7.6

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2021-06-11
- 1.0.3 — 2019-12-17
- 1.0.2 — 2019-11-21
- 1.0.1 — 2019-10-28
- 1.0.0 — 2019-10-15
- 0.0.1 — 2019-10-15

## README

# react-simply-tabs

[![npm version](https://img.shields.io/npm/v/react-simply-tabs.svg?style=flat)](https://www.npmjs.com/package/react-simply-tabs)
![npm bundle size](https://img.shields.io/bundlephobia/minzip/react-simply-tabs?label=size)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/vadymshymko/react-simply-tabs/blob/master/LICENSE)

Simple and small react.js tabs component 

## Table of contents

* [Installation](#installation)
* [Usage](#usage)
* [Props](#props)
* [Demo](#demo)

## Installation

**npm**

```bash
npm install react-simply-tabs --save
```

**yarn**

```bash
yarn add react-simply-tabs
```

## Usage

#### Basic Example:

```js
import React, { useState } from 'react';
import Tabs from 'react-simply-tabs';

const App = () => {
  const [activeTabIndex, setActiveTabIndex] = useState(0);

  return(
    <Tabs
      activeTabIndex={activeTabIndex}
      onRequestChange={setActiveTabIndex}
      controls={[
        <button type="button">
          Show 1
        </button>,
        <button type="button">
          Show 2
        </button>,
        <button type="button">
          Show 3
        </button>,
      ]}
    >
      <div>1 tab</div>

      <div>2 tab</div>

      <div>3 tab</div>
    </Tabs>
  );
};
```

## Props

Name | Type | Default Value | Description   
---- | ---- | ------------- | --------------
activeControlProps | object | `{}` | Props (valid DOM props or your custom props) for active control node. Will be merged with default control props
activeTabIndex | number | `0` | Index of visible tab
activeTabProps | object | `{}` | Props (valid DOM props or your custom props) for active tab node. Will be merged with default tab props
children | node | `null` | Tabs nodes
controls | array of nodes | `[]` | Array of controls nodes
controlsWrapperProps | object | `{}` | DOM props for div inside which will be rendered controls
hiddenTabProps | object | `{}` | Props (valid DOM props or your custom props) for hidden (not active) tab node. Will be merged with default tab props
onRequestChange | function | | Function that will be run when the activeTabIndex is requested to be changed (either by clicking on control) (required)
renderOnlyActiveTab | boolean | false | If `true` hidden tabs will not be rendered
tabsWrapperProps | object | {} | DOM props for div inside which will be rendered tabs
wrapperProps | object | {} | DOM props for div inside which will be rendered tabs && controls

## Demo

[![Edit react-simply-tabs](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-simply-tabs-hty96)

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