
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
react-tree-multi-select
Advanced tools
React component that combines tree select, multi-select and simple select functionality into a single versatile solution
react-tree-multi-select is a fast, highly customizable and feature-rich component that combines tree select, multi-select and simple select functionality into a single versatile solution.
See documentation website for documentation and live examples.
You can install react-tree-multi-select via npm:
npm install react-tree-multi-select
Basic usage
import React, {FC} from 'react';
import {CheckedState, TreeNode, TreeMultiSelect} from 'react-tree-multi-select';
export const ReactTreeMultiSelectApp: FC = () => {
const data: TreeNode[] = [
{
label: 'label1',
children: [
{
label: 'child11-label'
},
{
label: 'child12-label'
}
]
},
{
label: 'label2',
children: [
{
label: 'child21-label'
},
{
label: 'child22-label'
}
]
},
{
label: 'label3'
}
];
const handleNodeChange = (node: TreeNode, selectedNodes: TreeNode[]): void => {
console.log('handleNodeChange node:', node);
console.log('handleNodeChange selectedNodes:', selectedNodes);
};
const handleNodeToggle = (node: TreeNode, expandedNodes: TreeNode[]): void => {
console.log('handleNodeToggle node:', node);
console.log('handleNodeToggle expandedNodes:', expandedNodes);
};
const handleClearAll = (selectedNodes: TreeNode[], selectAllCheckedState: CheckedState | undefined): void => {
console.log('handleClearAll selectedNodes:', selectedNodes);
console.log('handleClearAll selectAllCheckedState:', selectAllCheckedState);
};
const handleSelectAllChange = (selectedNodes: TreeNode[], selectAllCheckedState: CheckedState): void => {
console.log('handleSelectAllChange selectedNodes:', selectedNodes);
console.log('handleSelectAllChange selectAllCheckedState:', selectAllCheckedState);
};
return (
<TreeMultiSelect
data={data}
withSelectAll
onNodeChange={handleNodeChange}
onNodeToggle={handleNodeToggle}
onClearAll={handleClearAll}
onSelectAllChange={handleSelectAllChange}
/>
);
});
This project is licensed under the MIT License - see the LICENSE file for details.
If you find my work helpful, you can support me by buying me a coffee. Thank you for your support!
FAQs
React component that combines tree select, multi-select and simple select functionality into a single versatile solution
The npm package react-tree-multi-select receives a total of 68 weekly downloads. As such, react-tree-multi-select popularity was classified as not popular.
We found that react-tree-multi-select demonstrated a healthy version release cadence and project activity because the last version was released less than 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.