
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
@idui/react-toggle-controls
Advanced tools
npm install --save @idui/react-toggle-controls
yarn add @idui/react-toggle-controls
import React, { useState } from 'react'
import { Checkbox } from '@idui/react-toggle-controls'
function CheckboxExample() {
const [checked, setChecked] = useState(false);
return <Checkbox
checked={checked}
onChange={setChecked}
size="20px"
label="Check"
icon={<span>{'✓'}</span>}
colors={{
on: { background: '#37D2C5', border: '#37D2C5', icon: '#FFFFFF' },
off: { background: 'transparent', border: '#CCCCCC', icon: 'transparent', hover: { border: '#37D2C5' } },
disabled: { background: '#F5F5F5', border: '#D9D9D9', icon: '#D9D9D9' }
}}
/>
}
import React, { useState } from 'react'
import { Radio } from '@idui/react-toggle-controls'
function RadioExample() {
const [checked, setChecked] = useState(false);
return <Radio
checked={checked}
onChange={setChecked}
handleSize="20px"
toggleSize="12px"
label="Check"
colors={{
on: { toggle: '#37D2C5', border: '#37D2C5' },
off: { toggle: 'transparent', border: '#37D2C5' },
disabled: { toggle: '#D9D9D9', border: '#D9D9D9' }
}}
/>
}
import React, { useState } from 'react'
import { Switch } from '@idui/react-toggle-controls'
function SwitchExample() {
const [checked, setChecked] = useState(false);
return <Switch
checked={checked}
onChange={setChecked}
handleSize={['36px', '16px']}
toggleSize="22px"
label="Check"
colors={{
on: { toggle: '#37D2C5', handle: '#37D2C5', icon: '#FFFFFF' },
off: { toggle: '#FFFFFF', handle: '#CCCCCC', icon: '#CCCCCC' },
disabled: { toggle: '#F5F5F5', handle: '#D9D9D9', icon: '#D9D9D9' }
}}
icons={{ on: <span>{'✓'}</span>, off: <span>{'✘'}</span> }}
/>
}
import React from 'react'
import ToggleControl from '@idui/react-toggle-controls'
function CustomToggle({ checked, disabled, label, onText, offText, className, ...props }) {
return <label className={className} style={{ color: disabled ? 'gray' : 'black' }}>
<ToggleControl checked={checked} disabled={disabled} {...props} />
<span>{checked ? onText : offText}</span>
{label && <span>{label}</span>}
</label>
}
CustomToggle.propTypes = {
...ToggleControl.propTypes,
className: PropTypes.string,
label: PropTypes.string,
onText: PropTypes.string,
offText: PropTypes.string,
};
CustomToggle.defaultProps = {
...ToggleControl.defaultProps,
onText: 'On',
offText: 'Off'
};
MIT © kaprisa57@gmail.com
FAQs
React Toggle Controls
The npm package @idui/react-toggle-controls receives a total of 106 weekly downloads. As such, @idui/react-toggle-controls popularity was classified as not popular.
We found that @idui/react-toggle-controls demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.