JSPM

  • Created
  • Published
  • Downloads 1714193
  • Score
    100M100P100Q194119F

tabs ui component for react

Package Exports

  • rc-tabs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rc-tabs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

rc-tabs


react tabs component

NPM version build status Test coverage gemnasium deps node version npm download Sauce Test Status

Sauce Test Status

Screenshot

install

rc-tabs

Feature

Keyboard

  • left and up: switch to previous tab
  • right and down: switch to next tab

Usage

var Tabs = require('rc-tabs');
var TabPane = Tabs.TabPane;

var callback = function(eventKey){

}

React.render(
  (
    <Tabs activeKey="2" onChange={callback}>
      <TabPane tab='tab 1' key="1">first</TabPane>
      <TabPane tab='tab 2' key="2">second</TabPane>
      <TabPane tab='tab 3' key="3">third</TabPane>
    </Tabs>
  ),
  document.getElementById('t2'));

Development

npm install
npm start

API

Tabs

props:

name type default description
activeKey Object first active tabPanel's eventKey same with active tabPanel's eventKey
onChange Function(eventKey) called when tabPanel is changed

TabPane

props:

name type default description
key Object corresponding to activeKey
tab String current tab's title corresponding to current tabPane

Test Case

http://localhost:8000/tests/runner.html?coverage

Coverage

http://localhost:8000/node_modules/node-jscover/lib/front-end/jscoverage.html?w=http://localhost:8000/tests/runner.html?coverage

License

rc-tabs is released under the MIT license.