npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

custom-dropdown-react

v1.7.0

Published

A simple dropdown component for React

Readme

Mon Custom Dropdown React Component

Un composant de dropdown personnalisé pour React.

Installation

Vous pouvez installer ce composant en utilisant npm ou yarn :

npm install mon-custom-dropdown-react
# ou
yarn add mon-custom-dropdown-react

Utilisation

Pour utiliser le composant Dropdown dans votre application React, vous devez l'importer comme suit :

import { Dropdown } from 'mon-custom-dropdown-react';

// Utilisez le composant Dropdown dans votre JSX
function App() {
  return (
    <div>
      <h1>Mon Application React</h1>
      <Dropdown title="Custom-title" children={['option 1', 'option 2', 'option 3']} onChange/>
    </div>
  );
}

export default App;

Le composant Dropdown peut être utilisé en passant les propriétés requises :

const App = () => {

  return (
    <div>
      <Dropdown
          title="Sélectionner une option"
          children={[
            { name: "Option 1", keys: "key1" },
            { name: "Option 2", keys: "key2" },
            // Ajoutez plus d'options au besoin
          ]}
          onChange={(selectedOption) => {
            console.log("Option sélectionnée :", selectedOption);
            // Gérez l'option sélectionnée
          }}
          // Paramètre optionelle de personnalisation
          size="16px"
          color="white"
          backgroundColor="white"
          borderColor="#0056b3"
          borderRadius="5px"
          backgroundColorItem="#3f8cde"
          colorItem="white"
          backgroundColorItemHover="#b95959"
      />
  </div>
  )
}

Popriétés

  • title (chaîne de caractères) : Le titre du menu déroulant.
  • children (tableau) : Un tableau d'objets représentant les options du menu déroulant, chaque objet ayant une propriété name et keys.
  • onChange (fonction) : Une fonction de rappel déclenchée lorsqu'une option est sélectionnée. Elle reçoit l'option sélectionnée en tant qu'argument.
  • size (chaîne de caractères) : La taille de la police du bouton du menu déroulant (par défaut : "16px").
  • color (chaîne de caractères) : La couleur du texte du bouton du menu déroulant (par défaut : "white").
  • backgroundColor (chaîne de caractères) : La couleur de fond du bouton du menu déroulant (par défaut : "white").
  • borderColor (chaîne de caractères) : La couleur de la bordure du bouton du menu déroulant (par défaut : "#0056b3").
  • borderRadius (chaîne de caractères) : Le rayon de la bordure du bouton du menu déroulant (par défaut : "5px").
  • backgroundColorItem (chaîne de caractères) : La couleur de fond des éléments du menu déroulant (par défaut : "#3f8cde").
  • colorItem (chaîne de caractères) : La couleur du texte des éléments du menu déroulant (par défaut : "white").
  • backgroundColorItemHover (chaîne de caractères) : La couleur de fond des éléments du menu déroulant au survol (par défaut : "#b95959").