# give/4.16.8.1/blocks/components/toggle/index.js

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.8.1. 18 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.8.1/code/blocks/components/toggle/index.js
- Raw: https://pluginprobe.com/plugins/give/4.16.8.1/raw/blocks/components/toggle/index.js
- Modified: 2022-06-29T23:03:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.16.8.1/code/blocks/components/toggle/index.js#L10-L20`.

```javascript
import {__} from '@wordpress/i18n';
import './style.scss';

export default function ({options, onClick, selected}) {
    return (
        <div className="give-toggle">
            {options.map(({value, label}, i) => {
                return  (<div
                            key={i}
                            onClick={() => onClick(value)}
                            className="give-toggle__option" style={ selected === value ? {background: '#007cba', color: 'white'} : {}}>
                            {label}
                        </div>)
            })}
        </div>
    );
}

```
