UNPKG

@worldresources/gfw-components

Version:

React component library for the Global Forest Watch project.

15 lines (13 loc) 310 B
Simple switch component that can be used as a toggle or tabs. ```js const [side, setSide] = React.useState('left'); <Switch value={side} options={[ { label: 'left', value: 'left' }, { label: 'right', value: 'right' }, ]} onChange={() => setSide(side === 'left' ? 'right' : 'left')} /> ```