
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
simple-react-select
Advanced tools
Test will finish soooooooooooooooooooooooooooooooooooooooooooooooooon! ( •̀ᄇ• ́)ﻭ✧
$ yarn add simple-react-select
// or
$ npm install simple-react-select --save
Then you need to import its component and css:
import Select from 'simple-react-select'
import 'simple-react-select/lib/simple-react-select.css'
"peerDependencies": {
"react": "^16.8.6",
"react-dom": "^16.8.6"
}
Now, let's place component in your Web APP!
import React, {memo, useState} from 'react';
import Select from 'simple-react-select';
import 'simple-react-select/lib/simple-react-select.css'
const App = memo(() => {
const optionList = [
{ value: 'Ocean', color: '#00B8D9' },
{ value: 'Blue', color: '#0052CC', isDisabled: true },
{ value: 'Purple', color: '#5243AA' },
{ value: 'Red', color: '#FF5630' },
{ value: 'Orange', color: '#FF8B00' },
{ value: 'Yellow', color: '#FFC400' },
{ value: 'Green', color: '#36B37E' },
{ value: 'Forest', color: '#00875A' },
{ value: 'Slate', color: '#253858' },
{ value: 'Silver', color: '#666666' },
];
const stateSelect = useState('');
const attribute = {
select: stateSelect[0],
onSelectChange: val => stateSelect[1](val),
};
return (
<div>
<Select {...attribute}>
{optionList.map(item => {
return (
<div key={item.value} value={item.value} disabled={item.isDisabled}>
{item.value}
</div>
);
})}
</Select>
</div>
);
});
If you wanna explore more usages, here's a playground on CodeSandBox.io.
| Props | Description | Type | Opt | Default |
|---|---|---|---|---|
| placeholder | change the text displayed when no option is selected | string | — | — |
| select | control the current value | string | — | — |
| noOptionsText | Text to display when there are no options | string | — | — |
| loadingText | Text to display when loading | string | — | — |
| isLoadingIcon | need loading icon or not when loading | boolean | — | true |
| selectCustomStyle | select custom style | object | { width: '300px', selectColor: stateBgColor[0], selectBorderRadius: '0', selectBorderColor: 'black', activeBorderColor: 'red' } | {} |
| optionsCustomStyle | options custom style | object | { maxHeight: '200px', optionsBorderColor: 'black', optionsBorderRadius: '0', optionHoverBgColor: '#eee', optionActiveBgColor: 'pink', optionActiveColor: 'blue'} | {} |
| optionsIsLoading | loading control | boolean | — | false |
| onSelectChange | subscribe to change events | function | — | (res) => {} |
| isSearchable | allow the user to search for matching options | boolean | — | false |
| isClearable | clear select or input value | boolean | — | false |
FAQs
react select component
We found that simple-react-select 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.