
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-item-select
Advanced tools
A React component that takes away the pain of managing item selection state in tables and lists
A React component that takes away the pain of managing item selection state in tables and lists
https://react-item-select.now.sh
npm i --save react-item-select
import withSelections from 'react-item-select';
const MyBasicList = ({ handleSelect, isItemSelected }) => (
<div>
<div>
<input name="first" type="checkbox" checked={isItemSelected(1)} onChange={handleSelect(1)} />
</div>
<div>
<input name="first" type="checkbox" checked={isItemSelected(2)} onChange={handleSelect(2)} />
</div>
</div>
export default withSelections(MyBasicList);
import withSelections from 'react-item-select';
const items = [{id: 1, name: 'One'}, {id: 2, name: 'Two'}, {id: 3, name: 'Three'}];
const MyTable = ({ handleSelect, isItemSelected }) => (
<table>
<tbody>
{items.map(item => (
<tr>
<td>
<input name="first" type="checkbox" checked={isItemSelected(item.id)} onChange={handleSelect(item.id)} />
</td>
<td>
{item.name}
</td>
</tr>
))}
</tbody>
</table>
);
export default withSelections(MyTable);
import withSelections from 'react-item-select';
import { Table } from 'semantic-ui-react';
const items = [{id: 1, name: 'One'}, {id: 2, name: 'Two'}, {id: 3, name: 'Three'}];
const MyTable = ({ handleSelect, isItemSelected }) => (
<Table>
<Table.Body>
{items.map(item => (
<Table.Row>
<Table.Cell>
<Checkbox checked={isItemSelected(item.id)} onChange={handleSelect(item.id)} />
</Table.Cell>
<Table.Cell>
{item.name}
</Table.Cell>
</Table.Row>
))}
</Table.Body>
</Table>
);
export default withSelections(MyTable);
| Property | Description | Type |
|---|---|---|
| areAllIndeterminate(items) | true if at least one item is selected not all items are selected | function |
| areAllSelected(items) | true if all items are selected, otherwise false | function |
| areAnySelected | true if at least one item in the list is selected, otherwise false | boolean |
| handleClearAll() | Deselects all items | function |
| handleSelect(id) | Toggles an item (e.g. when a user clicks a checkbox) | function |
| handleSelectAll(items) | Toggles all items | function |
| isItemSelected(item.id) | true if the item is selected, otherwise false | function |
| selectedCount | The number of items selected | number |
| selections | Keyed object where the key is a specified id and the value is true if the item is in the list | object |
FAQs
A React component that takes away the pain of managing item selection state in tables and lists
We found that react-item-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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.