Socket
Socket
Sign inDemoInstall

rc-tree-select

Package Overview
Dependencies
Maintainers
7
Versions
259
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-tree-select

tree-select ui component for react


Version published
Weekly downloads
1.4M
increased by6.47%
Maintainers
7
Weekly downloads
 
Created

What is rc-tree-select?

The rc-tree-select package is a React component for creating tree selection UI elements. It allows users to select one or multiple items from a hierarchical tree structure. It is commonly used in scenarios where a user needs to select categories, nested options, or any other items that are organized in a tree-like structure.

What are rc-tree-select's main functionalities?

Single Selection

This feature allows users to select a single item from the tree. The `treeData` prop is used to pass the hierarchical data to the component, and `treeDefaultExpandAll` expands all tree nodes by default.

import TreeSelect from 'rc-tree-select';

<TreeSelect
  style={{ width: 300 }}
  dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
  treeData={treeData}
  placeholder="Please select"
  treeDefaultExpandAll
/>

Multiple Selection

This feature enables multiple selections. The `multiple` prop indicates that multiple items can be selected.

import TreeSelect from 'rc-tree-select';

<TreeSelect
  style={{ width: 300 }}
  dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
  multiple
  treeData={treeData}
  placeholder="Please select"
  treeDefaultExpandAll
/>

Searchable Nodes

This feature adds a search input to the component, allowing users to filter tree nodes. The `showSearch` prop enables the search functionality.

import TreeSelect from 'rc-tree-select';

<TreeSelect
  style={{ width: 300 }}
  dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
  treeData={treeData}
  showSearch
  placeholder="Please select"
  treeDefaultExpandAll
/>

Asynchronous Data Loading

This feature allows for the loading of tree data asynchronously. The `loadData` prop is a function that is called to load data for a particular node when it is expanded.

import TreeSelect, { TreeNode } from 'rc-tree-select';

<TreeSelect
  loadData={onLoadData}
  treeData={treeData}
  style={{ width: 300 }}
  treeDefaultExpandAll
/>

Other packages similar to rc-tree-select

Keywords

FAQs

Package last updated on 17 Nov 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc