# react-simple-panels

> A simple React Panels without tabs and internal state

Latest version **1.0.1** (published 2015-11-16) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2015-11-16 |
| First published | 2015-11-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Anton Petrov |
| Maintainers | itsmepetrov |
| Keywords | react, panel, panels, list, switch, tab, tabs |

## Links

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

## 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) — 2015-11-16
- 1.0.0 — 2015-11-16

## README

# React Simple Panels

[![build status](https://img.shields.io/travis/itsmepetrov/react-simple-panels/master.svg?style=flat-square)](https://travis-ci.org/itsmepetrov/react-simple-panels)
[![npm version](https://img.shields.io/npm/v/react-simple-panels.svg?style=flat-square)](https://www.npmjs.com/package/react-simple-panels)

A simple React Panels without tabs and internal state

### Installation

```
npm install --save react-simple-panels
```

## Example


```js
import React, { Component } from 'react';
import { PanelList, Panel } from 'react-simple-panels';

const Types = {
    FIRST: 'FIRST',
    SECOND: 'SECOND',
    THIRD: 'THIRD'
}

export default class StatefulPanels extends Component {
    state = {
        activeIndex: Types.FIRTS
    }

    render() {
        return {
            <PanelList activeIndex={this.state.activeIndex}>
                <Panel index={Types.FIRST}>
                    <span onClick={() => this.changeActiveIndex(Types.SECOND)}>
                        This is a first panel
                    </span> 
                </Panel>
                <Panel index={Types.SECOND}>
                    <span onClick={() => this.changeActiveIndex(Types.THIRD)}>
                        This is a second panel
                    </span>
                </Panel>
                <Panel index={Types.THIRD}>
                    <span onClick={() => this.changeActiveIndex(Types.FIRST)}>
                        This is a third panel
                    </span>
                </Panel>
            </PanelList>
        }
    }

    changeActiveIndex(activeIndex) {
        this.setState({ activeIndex });
    }
}
```

## Props

**PanelList**:

- `activeIndex`: Name of the panel index you want to be active.
- anything else you'd like to set on the containing div

**Panel**:

- `index`: a unique name for the panel.
- anything else you'd like to set on the panel's containing div.

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