1.4.0 • Published 5 years ago

@schibstedspain/sui-layout-breakpoint-split v1.4.0

Weekly downloads
12
License
MIT
Repository
-
Last release
5 years ago

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 &gt;</button>
  </div>

  <div>
    RIGHT VIEW {current == 1 && '(active)'}
    <button onClick={this.setView.bind(this, 0)}>Prev &lt;</button>
  </div>
</LayoutBreakpointSplit>
</div>)