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

ilandols-demo-badge

v0.4.3

Published

Badge flottant affichant les identifiants de démo d'un projet dans une bulle au clic.

Readme

ilandols-demo-badge

Badge flottant (bas-droite) qui affiche, au clic, une bulle avec les identifiants de démo d'un projet. Basé sur un Web Component (<ilandols-demo-badge>), utilisable dans n'importe quel projet — React aujourd'hui, autre chose demain.

Installation

npm install ilandols-demo-badge

Usage vanilla / HTML

<script type="module">
  import "ilandols-demo-badge";
</script>

<ilandols-demo-badge id="badge" heading="Compte de démo"></ilandols-demo-badge>

<script type="module">
  document.getElementById("badge").credentials = [
    { label: "Email", value: "[email protected]" },
    { label: "Mot de passe", value: "demo1234" },
  ];
</script>

Usage React

import { IlandolsDemoBadge } from "ilandols-demo-badge/react";

function App() {
  return (
    <IlandolsDemoBadge
      heading="Compte de démo"
      description="Accès sans inscription."
      credentials={[
        { label: "Email", value: "[email protected]" },
        { label: "Mot de passe", value: "demo1234" },
      ]}
    />
  );
}

Props / attributs

| Nom | Type | Description | | ------------- | -------------------- | ------------------------------------------------- | | icon | string | URL de l'icône du badge (défaut : icône générique) | | heading | string | Titre de la bulle | | description | string | Texte optionnel sous le titre | | credentials | {label, value}[]ou {label, credentials}[] | Champs affichés, copiables au clic sur "Copier" (voir Plusieurs comptes) | | hidden | boolean | Masque le badge | | lang | "fr" \| "en" | Langue du texte "J'ai compris" (défaut "en") |

En HTML pur, credentials peut aussi être passé en attribut JSON : credentials='[{"label":"Email","value":"[email protected]"}]'.

Plusieurs comptes

Pour proposer plusieurs profils de démo, passe à credentials une liste de comptes ({ label, credentials }) au lieu d'une liste de champs. Chaque compte est affiché dans sa propre section titrée :

<IlandolsDemoBadge
  heading="Comptes de démo"
  credentials={[
    {
      label: "Admin",
      credentials: [
        { label: "Email", value: "[email protected]" },
        { label: "Mot de passe", value: "demo1234" },
      ],
    },
    {
      label: "Client",
      credentials: [
        { label: "Email", value: "[email protected]" },
        { label: "Mot de passe", value: "demo1234" },
      ],
    },
  ]}
/>

L'équivalent en attribut JSON :

<ilandols-demo-badge
  credentials='[{"label":"Admin","credentials":[{"label":"Email","value":"[email protected]"}]},
                {"label":"Client","credentials":[{"label":"Email","value":"[email protected]"}]}]'
></ilandols-demo-badge>

S'il n'y a qu'un seul compte, son titre n'est pas affiché : le rendu est identique à celui d'une simple liste de champs.

Masquage

Le badge est cachable de deux façons :

  • Par le développeur : <ilandols-demo-badge hidden> ou, en React, <IlandolsDemoBadge hidden />.
  • Par le visiteur : un lien "J'ai compris" en bas de la bulle. Ce choix est mémorisé via sessionStorage — le badge reste caché tant que l'onglet reste ouvert (y compris après un rechargement), mais réapparaît dans un nouvel onglet/une nouvelle session.

Si plusieurs badges sont présents sur la même page, donne-leur un id distinct pour que leur masquage par le visiteur ne se mélange pas.

Développement

npm install
npm run dev       # playground de test dans le navigateur
npm run build     # build de la lib (dist/)
npm run typecheck