New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

custom-dropdown-react-bl

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

custom-dropdown-react-bl

An accessible and customizable dropdown component for React

latest
npmnpm
Version
1.2.3
Version published
Weekly downloads
2
-87.5%
Maintainers
1
Weekly downloads
 
Created
Source

custom-dropdown-react-bl

A customizable, accessible, and lightweight dropdown component for React.

npm license React

✨ Features

  • 🧩 Custom label, placeholder, and selected value
  • 🎯 Keyboard accessible
  • 🎨 Clean and minimal default styling
  • ⚡ Lightweight and React 16+ compatible
  • ♿️ 100% Accessibility (Lighthouse validated)

🚀 Installation

npm install custom-dropdown-react-bl

## import and usage

import CustomDropdown from 'custom-dropdown-react-bl';
import 'custom-dropdown-react-bl/dist/CustomDropdown.css'; // Required styles

const options = [
  { label: 'Apple', value: 'apple' },
  { label: 'Banana', value: 'banana' },
];

function Example() {
  const [selected, setSelected] = useState(null);

  return (
    <CustomDropdown
      label="Fruits"
      value={selected}
      onChange={setSelected}
      options={options}
      placeholder="Select a fruit"
    />
  );
}

## Props

| Prop          | Type                              | Required | Description                        |
| ------------- | --------------------------------- | -------- | ---------------------------------- |
| `label`       | `string`                          | No       | Optional label above the dropdown  |
| `value`       | `any`                             | No       | Currently selected value           |
| `onChange`    | `(value: any) => void`            | Yes      | Callback triggered on value change |
| `options`     | `{ label: string, value: any }[]` | Yes      | List of dropdown options           |
| `placeholder` | `string`                          | No       | Placeholder when no value selected |

#Accessibility

This component follows accessibility best practices:

    Keyboard navigation (up/down/enter/escape)

    Focus trap on open

    Contrast-optimized placeholder text

    Semantic HTML structure

    Supports screen readers

    Passes Lighthouse Accessibility audits (100%)

#Example with Form

const departments = [
  { label: 'Sales', value: 'sales' },
  { label: 'Engineering', value: 'engineering' },
];

<CustomDropdown
  label="Department"
  value={selectedDept}
  onChange={setSelectedDept}
  options={departments}
  placeholder="Select a department"
/>

#links

🔗 Links

    📦 View on npm :https://www.npmjs.com/package/custom-dropdown-react-bl

    💻 Compatible with React 16, 17, 18, 19+

Keywords

react

FAQs

Package last updated on 23 May 2025

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