@schibstedspain/sui-layout-breakpoint-split
v1.4.0
Published
> Show or hide views according to the breakpoint.
Downloads
1
Readme
LayoutBreakpointSplit
Show or hide views according to the breakpoint.
Installation
$ npm install @schibstedspain/sui-layout-breakpoint-split --save
Usage
Basic usage
import LayoutBreakpointSplit from '@schibstedspain/sui-layout-breakpoint-split'
setView(current) {
this.setState({current})
}
const current = this.state && this.state.current || 0
return (<div>
<LayoutBreakpointSplit breakpoint={575} current={current}>
<div>
LEFT VIEW {current == 0 && '(active)'}
<button onClick={this.setView.bind(this, 1)}>Next ></button>
</div>
<div>
RIGHT VIEW {current == 1 && '(active)'}
<button onClick={this.setView.bind(this, 0)}>Prev <</button>
</div>
</LayoutBreakpointSplit>
</div>)