
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
dropdown-sample
Advanced tools
dropdown component library
npm i --save dropdown-sample
npm i --save antd
npm i --save styled-components
import React, { Component } from 'react'
import Dropdown from 'dropdown-sample'
class Example extends Component {
render () {
return (
<Dropdown
options={[
{ key: 'one', value: 'A simple option' },
{ key: 'two', value: 'A second option' },
{ key: 'three', value: 'Third and final!' },
{ key: 'four', value: 'mangos' },
]}
placeholder="Select an Option"
size="small"
onChange={() => {}}
onFocus={() => {}}
onBlur={() => {}}
/>
)
}
}
usage with icon emojis.
<Dropdown
options={[
{key: 'one', value: 'strawberry', icon: '🍓'},
{key: 'two', value: 'watermelon', icon: '🍉' },
{key: 'three', value: 'mango', icon: '🥭' },
{key: 'four', value: 'avocado', icon: '🥑' },
{key: 'five', value: 'pear', icon: '🍐' },
]}
placeholder="Select an option (w/ a cute fruit icon!)"
size="medium"
onChange={() => console.log('On change FIRED 🚀')}
onFocus={() => console.log('On focus FIRED 🚀')}
onBlur={() => console.log('On blur FIRED 🚀')}
/>
usage with icon emojis + descriptions.
<Dropdown
options={[
{key: 'one', value: 'I have a description', icon: '🍓', description: 'I am an option with a cool fancy description on the bottom!'},
{key: 'two', value: 'Option 2', icon: '🍓', description: 'If you pick me, yay!'},
{key: 'three', value: 'Watermelon', icon: '🍓', description: 'Should we make watermelons smoothies?'},
]}
placeholder="Select an option (w/ a description!)"
size="large"
onChange={() => console.log('On change FIRED 🚀')}
onFocus={() => console.log('On focus FIRED 🚀')}
onBlur={() => console.log('On blur FIRED 🚀')}
/>
Clone the repository
git clone <path_to_repo>
Install the dependancies
cd <path_to_repo>
yarn install
Start up the component library
yarn start
Open a new terminal tab and navigate to example directory
cd <path_to_repo>/example
Install the dependancies for the example react app
yarn install
Start the development server. A browser window should open with some examples of the dropdown :)
yarn start
Prop | usage |
---|---|
Options | options take a key (string), value (string), icon (emoji/string), and a description (string). |
placeholder | the placeholder before an option is selected (string) |
size | can be 'small', 'medium' or 'large' (string) |
onChange | an function thats fired when an option is selected |
onFocus | an function thats fired on component focus |
onBlur | an function thats fired on component blur |
MIT © ejdweck
FAQs
A simple dropdown component library
The npm package dropdown-sample receives a total of 1 weekly downloads. As such, dropdown-sample popularity was classified as not popular.
We found that dropdown-sample 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
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.