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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@devsyrilpackages/react-loader-button

v0.1.4

Published

```md # 🌀 LoaderButton – Un bouton React avec indicateur de chargement

Readme

# 🌀 LoaderButton – Un bouton React avec indicateur de chargement

**@devsyrilpackages/react-loader-button** est un composant React léger et personnalisable qui affiche un indicateur de chargement pendant une action asynchrone. Idéal pour les formulaires, les appels API, ou toute interaction utilisateur nécessitant un retour visuel immédiat.

---

## 🚀 Installation

```bash
npm install @devsyrilpackages/react-loader-button
# ou
yarn add @devsyrilpackages/react-loader-button

đź”§ Utilisation de base

import React, { useState } from 'react';
import { LoaderButton } from '@devsyrilpackages/react-loader-button';
import '@devsyrilpackages/dist/react-loader-button.esm.css';

function App() {
  const [loading, setLoading] = useState(false);

  const handleClick = async () => {
    setLoading(true);
    await new Promise((r) => setTimeout(r, 2000));
    setLoading(false);
  };

  return (
    <LoaderButton loading={loading} onClick={handleClick}>
      Envoyer
    </LoaderButton>
  );
}

📦 Props

| Prop | Type | Description | |------------|----------------------|-----------------------------------------------------------------------------| | loading | boolean | Active l’indicateur de chargement. Désactive automatiquement le bouton. | | disabled | boolean | Désactive le bouton manuellement. | | onClick | () => void | Fonction appelée lors du clic. | | children | React.ReactNode | Contenu du bouton (texte, icône, etc.). |


🎨 Personnalisation

Le style par défaut est minimaliste. Tu peux le surcharger via CSS ou intégrer une solution comme Tailwind, styled-components ou CSS Modules.

Exemple avec Tailwind

<LoaderButton
  loading={loading}
  className="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded"
>
  Sauvegarder
</LoaderButton>

đź§Ş Tests

Ce package est compatible avec Jest, Vitest ou Testing Library. Exemple de test :

import { render, screen } from '@testing-library/react';
import { LoaderButton } from '@syril/loader-button';

test('affiche le loader quand loading est true', () => {
  render(<LoaderButton loading={true}>Valider</LoaderButton>);
  expect(screen.getByRole('button')).toBeDisabled();
});

🛠️ Développement local

git clone https://github.com/rilboy/react-loader-button.git
cd react-loader-button
yarn install
yarn start

📤 Publication

Ce package est construit avec TSDX. Pour publier :

yarn build
npm publish --access public

📚 Roadmap

  • [ ] Support des icĂ´nes (avant/après le texte)
  • [ ] Animation SVG ou Lottie
  • [ ] Variantes (primary, secondary, danger, etc.)
  • [ ] AccessibilitĂ© renforcĂ©e (ARIA)

🤝 Contribuer

Les contributions sont les bienvenues ! Forkez le repo, créez une branche, proposez une PR.

git checkout -b feature/amélioration-loader

đź“„ Licence

MIT © Syril kokou


💡 Inspiré par

Ce composant s’inscrit dans une démarche de modularité et de transparence, pensée pour les développeurs qui automatisent et enrichissent leurs interfaces avec rigueur et élégance.