Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@crave/farmblocks-dropdown
Advanced tools
Simple dropdown component. See [examples](https://cravefood.github.io/farmblocks/index.html?selectedKind=Dropdown) on storybook
Simple dropdown component. See examples on storybook
npm install @crave/farmblocks-dropdown
import React, { Component } from 'react';
import { render } from 'react-dom';
import {Dropdown, DropdownItem} from '@crave/farmblocks-dropdown';
class App extends Component {
render() {
return (
<Dropdown text='Select fruit'
align='left'
handleSelection={(value, event) => console.log('handle selection', value)}>
<DropdownItem value={1}>Banana</DropdownItem>
<DropdownItem value={2}>Apple</DropdownItem>
<DropdownItem value={3}>Apple</DropdownItem>
</Dropdown>
);
}
}
render(<App />, document.getElementById('root'));
This code will render:
Property | Description | Type | Required | Default |
---|---|---|---|---|
children | Pass children of DropdownItem instances | node | x | |
text | The dropdown label. Renders only the icon if this property is empty | string | '' | |
handleSelection | Function to handle selection of a DropdownItem. The first argument is the value, the second is the event | function | () => false | |
align | Align of dropdown items container | oneof(['left', 'right']) | left | |
zIndex | z-index passed to the dropdown items container | number |
Property | Description | Type | Required | Default |
---|---|---|---|---|
children | content to be rendered as the item text | node | ||
text | This property is rendered as children of the item component. If passed, it suppress the children property | string | ||
value | Option value. This property will be passed as the first argument on handleSelection property from Dropdown component | string or number |
MIT
FAQs
Simple dropdown component. See [examples](https://cravefood.github.io/farmblocks/index.html?selectedKind=Dropdown) on storybook
The npm package @crave/farmblocks-dropdown receives a total of 348 weekly downloads. As such, @crave/farmblocks-dropdown popularity was classified as not popular.
We found that @crave/farmblocks-dropdown demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.