Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-simple-panels

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-simple-panels

A simple React Panels without tabs and internal state

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Simple Panels

build status npm version

A simple React Panels without tabs and internal state

Installation

npm install --save react-simple-panels

Example

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.

Keywords

FAQs

Package last updated on 16 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc