
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
react-dropdown-cascade
Advanced tools
A [React](https://reactjs.org) component inpired by [rc-cascader](https://www.npmjs.com/package/rc-cascader) and without external dependencies.
A React component inpired by rc-cascader and without external dependencies.
npm install react-dropdown-cascade --save
or
yarn add react-dropdown-cascade
import React from 'react';
import DropdownCascade from 'react-dropdown-cascade';
const items = [
{
value: '1',
label: 'Menu 1',
children: [
{
value: '11',
label: 'Another Item'
},
{
value: '12',
label: 'More Items',
children: [
{
value: '121',
label: 'Sub Item A'
},
{
value: '122',
label: 'Sub Item B',
disabled: true
},
{
value: '123',
label: 'Sub Item C'
}
]
}
]
},
{
value: '2',
label: 'Menu 2'
},
{
value: '3',
label: 'Menu 3',
children: [
{
value: '31',
label: 'Hello'
},
{
value: '21',
label: 'World'
}
]
}
];
export default function App() {
return (
<>
<h1 style={{ margin: 15 }}>react-dropdown-cascade</h1>
<DropdownCascade
dropdownStyle={{ margin: '5px 20px 15px 20px' }}
items={items}
onSelect={(value, selectedItems) => console.log(value, selectedItems)}
>
<input placeholder="Click here" style={{ height: 24, width: 300 }} />
</DropdownCascade>
</>
);
}
Props
Prop | Type | Required | Default | Description |
---|---|---|---|---|
defaultValue | string | no | undefined | Initial value |
dropdownClassName | string | no | undefined | The additional className of dropdown |
dropdownStyle | CSSProperties | no | undefined | The additional style of dropdown |
dropdownMenuClassName | string | no | undefined | The additional className of dropdown menu |
dropdownMenuStyle | CSSProperties | no | undefined | The additional style of dropdown menu |
dropdownMenuItemClassName | string | no | undefined | The additional className of dropdown menu item |
dropdownMenuItemStyle | CSSProperties | no | undefined | The additional style of dropdown menu item |
dropdownSubItemClassName | string | no | undefined | The additional className of dropdown subitem |
dropdownSubItemStyle | CSSProperties | no | undefined | The additional style of dropdown subitem |
expandTrigger | "click" | "hover" | no | "click" | Trigger that shows the dropdown |
items | Item[] | yes | The data for cascade | |
onSelect | (value: string, selectedItems: Item[]) => void; | no | undefined | Callback when selecting an item |
interface Item {
value: string;
label: string;
disabled?: boolean;
children?: Item[];
}
FAQs
A [React](https://reactjs.org) component inpired by [rc-cascader](https://www.npmjs.com/package/rc-cascader), without external dependencies and styled like [material design](https://material.io/design).
The npm package react-dropdown-cascade receives a total of 285 weekly downloads. As such, react-dropdown-cascade popularity was classified as not popular.
We found that react-dropdown-cascade 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.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.