apeman-react-tab
apeman react package for tab component.
Installation
$ npm install apeman-react-tab --save
Demo
Live demo is hosted on GitHub Pages.
Usage
'use strict'
import React from 'react'
import {
ApTab,
ApTabItem,
ApTabStyle
} from 'apeman-react-tab'
const ExampleComponent = React.createClass({
getInitialState () {
return {
tab: 'FOO'
}
},
selectTab(tab) {
const s = this
s.setState({
tab: tab
})
},
render () {
const s = this
return (
<div>
<ApTabStyle />
<ApTab>
<ApTabItem selected={ s.state.tab === "FOO" } onTap={ () =>s.selectTab('FOO') }>foo</ApTabItem>
<ApTabItem selected={ s.state.tab === "BAR" } onTap={ () =>s.selectTab('BAR') }>bar</ApTabItem>
</ApTab>
</div>
)
}
})
Components
ApTabContent
Props
Name | Type | Default | Description |
---|---|---|---|
selected | bool |
ApTabGroup
Props
Name | Type | Default | Description |
---|
ApTabItem
Props
Name | Type | Default | Description |
---|
ApTabStyle
Props
Name | Type | Default | Description |
---|
ApTab
Props
Name | Type | Default | Description |
---|
License
This software is released under the MIT License.