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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-select-component-animated

v1.1.1

Published

## Installation: ### Run the following command: npm install react-select-component-animated

Downloads

91

Readme

react-select-component-animated created using create-react-app.

Installation:

Run the following command:

npm install react-select-component-animated

react-select-component-animated

Un composant React pour les sélections animées avec des transitions fluides et personnalisables.

Exemple :

import './App.css';
import { Select } from 'react-select-component-animated/dist/Select';
function App() {
let options = ["nom", "prénom"]
return (
<div>
  <h1>Example of react-select-component-animated</h1>
  <Select options={options} />
</div>
);
}

export default App;

Props

| Name | Description | Type | |-----------------|----------------------------------------------------------------------------------------------------------------------------------|----------| | label | Une étiquette descriptive pour le composant de sélection. Exemple : "Choisissez une option". | String | | options | Un tableau d'options disponibles pour la sélection. Exemple : ['Option 1', 'Option 2', 'Option 3']. | Array | | searchInput | Indique si un champ de recherche doit être affiché pour filtrer les options. Exemple : true. | Boolean | | fadeInDuration| Durée de l'animation de l'apparition du menu déroulant en CSS. Spécifiée en unités de temps CSS (comme s ou ms). Exemple : "0.3s". | String | | fadeOutDuration| Durée de l'animation de la disparition du menu déroulant en CSS. Spécifiée en unités de temps CSS (comme s ou ms). Exemple : "0.3s". | String | | debounceDelay | Délai de debounce en millisecondes pour la mise à jour du terme de recherche. Utilisé pour limiter la fréquence des mises à jour lors de la saisie dans le champ de recherche. Exemple : 300. | Number | | onChange | Fonction de rappel appelée lorsque la sélection change. Reçoit la nouvelle option sélectionnée en argument. Exemple : function handleChange(selectedOption) { console.log(selectedOption); } | Function | | value | La valeur actuellement sélectionnée. Peut être utilisée pour initialiser la sélection ou pour la mettre à jour de manière contrôlée. Exemple : "Option 1". | String |

Explication des fonctionnalités

Initialisation et état :

useState initialise et gère l'état local, comme l'ouverture du menu (isOpen), l'option sélectionnée (selectedOption), le terme de recherche (searchTerm) et les options filtrées (filteredOptions).

Effets :

  • useEffect initialise les options filtrées et met à jour les options disponibles et la sélection en réponse aux changements de props.

Gestion du menu déroulant :

  • toggleDropdown ouvre et ferme le menu.
  • handleOptionClick gère la sélection d'une option et ferme le menu.

Débounce :

  • debounce limite la fréquence de mise à jour du terme de recherche pour améliorer les performances.

Clavier et focus :

  • handleKeyDown et handleOptionKeyDown gèrent la navigation au clavier.
  • handleBlur ferme le menu lorsque le focus est perdu.

Styles :

  • containerStyle applique des variables CSS pour contrôler les animations.