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

hrnet-select-menu

v1.0.1

Published

Composant SelectMenu réutilisable pour React

Readme

HRnet SelectMenu

Composant SelectMenu réutilisable pour React avec support clavier complet et accessibilité.

✨ Fonctionnalités

  • 🎯 Accessibilité complète - Support clavier, ARIA, navigation
  • ⌨️ Navigation clavier - Flèches, Entrée, Échap
  • 🎨 Styles personnalisables - CSS variables pour le thème
  • 📱 Responsive - S'adapte à tous les écrans
  • 🔧 Contrôlé/Non-contrôlé - Support des deux modes
  • 🚀 Léger - Pas de dépendances externes

📦 Installation

npm install hrnet-select-menu

🚀 Utilisation Basique

import { SelectMenu } from 'hrnet-select-menu';

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

function MyComponent() {
  const [selected, setSelected] = useState('');

  return (
    <SelectMenu 
      options={options}
      value={selected}
      onChange={(e) => setSelected(e.target.value)}
      placeholder="Sélectionner un département..."
    />
  );
}

🎛️ Props API

| Prop | Type | Défaut | Description | |------|------|--------|-------------| | options | Array<{value: string, label: string}> | [] | Options disponibles | | value | string | '' | Valeur sélectionnée (mode contrôlé) | | defaultValue | string | '' | Valeur par défaut (mode non-contrôlé) | | onChange | (event) => void | - | Callback de changement | | placeholder | string | 'Select...' | Texte de placeholder | | id | string | - | ID du composant | | name | string | - | Nom du champ | | required | boolean | false | Champ requis |

🎨 Personnalisation CSS

:root {
  --border: #e6e9ee;
  --accent: #0b5fff;
  --card: #fff;
  --shadow: 0 8px 24px rgba(20,24,30,0.08);
}

.select-menu {
  /* Vos styles personnalisés */
}

⌨️ Navigation Clavier

  • Flèches ↑↓ : Naviguer dans les options
  • Entrée : Sélectionner l'option
  • Échap : Fermer le menu
  • Tab : Navigation entre les champs

📱 Exemple Complet

import React, { useState } from 'react';
import { SelectMenu } from 'hrnet-select-menu';

function EmployeeForm() {
  const [formData, setFormData] = useState({
    department: '',
    state: ''
  });

  const departments = [
    { value: 'sales', label: 'Sales' },
    { value: 'marketing', label: 'Marketing' },
    { value: 'engineering', label: 'Engineering' },
    { value: 'hr', label: 'Human Resources' }
  ];

  const states = [
    { value: 'AL', label: 'Alabama' },
    { value: 'CA', label: 'California' },
    { value: 'NY', label: 'New York' },
    { value: 'TX', label: 'Texas' }
  ];

  const handleChange = (field) => (e) => {
    setFormData(prev => ({
      ...prev,
      [field]: e.target.value
    }));
  };

  return (
    <form>
      <div>
        <label>Département</label>
        <SelectMenu
          name="department"
          options={departments}
          value={formData.department}
          onChange={handleChange('department')}
          placeholder="Sélectionner un département..."
          required
        />
      </div>
      
      <div>
        <label>État</label>
        <SelectMenu
          name="state"
          options={states}
          value={formData.state}
          onChange={handleChange('state')}
          placeholder="Sélectionner un état..."
          required
        />
      </div>
    </form>
  );
}

🧪 Tests

npm test

📄 Licence

MIT