
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
react-simpler-select
Advanced tools
React component that renders a select. Supports optgroups, multiple selections.
React component that renders a select. Supports optgroups, multiple selections.
Check out the online demo!
<select>
.<option>
elements itself from the expected data structure.placeholder
prop to create a placeholder option at the top of the select.<optgroup>
elements if the options
follow the expected data structure.onChange
returns supports single and multiple
values in a convenient format.npm install --save react-simpler-select
import Select from 'react-simpler-select';
const options = [
{ value: 'en', label: 'English' },
{ value: 'es', label: 'Spanish' },
];
<Select
placeholder="Choose a language"
value="en"
options={options}
onChange={onChange}
/>
// Add props as you go, they will be transfered to the `select` element.
<Select
value="en"
options={options}
onChange={this.handleChange}
autoFocus
/>
// Supports `optgroup`s with their own array of options.
const optgroups = [
{
title: 'North Island',
id: 'ni',
options: [ { value: 'wgtn', label: 'Wellington' }, { value: 'gsb', label: 'Gisbourne' } ]
},
{
title: 'South Island',
id: 'si',
options: [ { value: 'ch', label: 'Christchurch' }, { value: 'qt', label: 'Queenstown' } ]
},
];
<Select options={optgroups}/>
// Supports `multiple` select. Just make the `value` prop an array, and get selected options as an array in the `onChange` callback.
<Select value={[ 'ch', 'qt']}/>
Clone the project on your computer, and install Node. This project also uses nvm.
nvm install
# Then, install all project dependencies.
npm install
# Install the git hooks.
./.githooks/deploy
Everything mentioned in the installation process should already be done.
# Make sure you use the right node version.
nvm use
# Start the server and the development tools.
npm run start
# Runs linting.
npm run lint
# Runs tests.
npm run test
# View other available commands with:
npm run
package.json
, following semver.npm run dist
# Use irish-pub to check the package content. Install w/ npm install -g first.
irish-pub
npm publish
prop-types
as peerDependency (#26).pkg.module
field to enable tree shaking.FAQs
React component that renders a select. Supports optgroups, multiple selections.
The npm package react-simpler-select receives a total of 2 weekly downloads. As such, react-simpler-select popularity was classified as not popular.
We found that react-simpler-select demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers 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
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.