2.0.10 • Published 5 years ago
the-bar v2.0.10
the-bar
Bar of the-components
Installation
$ npm install the-bar --save
Usage
'use strict'
import React from 'react'
import { TheBar, TheActionBar, TheBarStyle } from 'the-bar'
import { TheButtonStyle } from 'the-button'
class ExampleComponent extends React.Component {
constructor (props) {
super(props)
this.state = {
action: true
}
}
render () {
return (
<div>
<a onClick={() => this.setState({action: !this.state.action})}>Toggle Action bar</a>
<br/>
<TheButtonStyle/>
<TheBarStyle/>
<TheBar id='my-component'>
</TheBar>
<TheActionBar lead='doSomething'
hidden={!this.state.action}
buttons={{yes: 'say yes!', no: 'say no!'}}
handlers={{yes: () => console.log('yes'), no: () => console.log('no')}}
/>
</div>
)
}
}
export default ExampleComponent
Components
TheActionBar
Bar of the-component
Props
Name | Type | Description | Default |
---|---|---|---|
buttons | object | Button texts | {} |
danger | object | Danger marks | {} |
handlers | object | Handler functions | {} |
hidden | bool | Hidden or not | false |
icons | object | Icon class names | {} |
lead | string | Lead text |
|
TheBar
Bar of the-component
TheBarStyle
Style for TheBar
Props
Name | Type | Description | Default |
---|---|---|---|
options | object | Style options | {} |
License
This software is released under the MIT License.