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

@poadio/ui-react

v0.9.1

Published

React rendering of the poad UI library: native React components (switch, button, field / input, select, named icons, badge, tag, chip, avatar, divider, skeleton, progress, meter, message, checkbox, radio, toggle button, segmented, button group, number, pa

Readme

@poadio/ui-react

Le rendu React de la bibliothèque de composants de poad : des composants React natifs posés sur le socle sans framework @poadio/ui-core (machines d'état, styles partagés, catalogue de messages). Même DOM, mêmes classes, mêmes attributs ARIA que @poadio/ui-angular — le banc de conformité joue les mêmes scénarios sur les deux.

  • React 19 (dépendance paire), ESM + .d.ts, construit par tsc seul (un fichier JS par composant).
  • Rendu serveur (Next.js, App Router) : aucun accès à window ni à document au chargement ni pendant le rendu ; les composants qui ont un état, un contexte ou des gestionnaires commencent par 'use client' ; PoadButton, PoadBadge, PoadTag, PoadAvatar / PoadAvatarGroup, PoadDivider, PoadSkeleton et PoadCard n'en ont pas besoin et se rendent aussi dans un composant serveur.
  • Aucun texte en dur : tout texte de la bibliothèque vient du catalogue (UI_EN, UI_FR), garde tools/check-i18n.mjs ui-react (gabarits JSX compris).

Installation

npm i @poadio/ui-react @poadio/ui-core

Styles : les feuilles du socle, une fois, dans la feuille globale de l'application (Next.js : app/layout.tsx).

import '@poadio/ui-core/tokens.css';
import '@poadio/ui-core/base.css';    // focus, mouvement réduit, .poad-input
import '@poadio/ui-core/switch.css';
import '@poadio/ui-core/button.css';
import '@poadio/ui-core/field.css';
import '@poadio/ui-core/select.css';       // PoadSelect : déclencheur, panneau, filtre, feuille basse
import '@poadio/ui-core/option-list.css';  // … ses options
import '@poadio/ui-core/icon.css';         // PoadIcon et icônes des composants
// atomes, selon ce que l'application utilise :
import '@poadio/ui-core/badge.css';    import '@poadio/ui-core/tag.css';      import '@poadio/ui-core/chip.css';
import '@poadio/ui-core/avatar.css';   import '@poadio/ui-core/divider.css';  import '@poadio/ui-core/skeleton.css';
import '@poadio/ui-core/progress.css'; import '@poadio/ui-core/meter.css';    import '@poadio/ui-core/message.css';
import '@poadio/ui-core/checkbox.css'; import '@poadio/ui-core/radio.css';    import '@poadio/ui-core/segmented.css';
import '@poadio/ui-core/toggle-button.css'; import '@poadio/ui-core/button-group.css';
// champs
import '@poadio/ui-core/number.css';   import '@poadio/ui-core/password.css'; import '@poadio/ui-core/rating.css';
import '@poadio/ui-core/slider.css';   import '@poadio/ui-core/inplace.css';
// flottants — floating.css et sheet.css aussi pour PoadSelect (panneau et feuille basse)
import '@poadio/ui-core/floating.css'; import '@poadio/ui-core/sheet.css';
import '@poadio/ui-core/tooltip.css';  import '@poadio/ui-core/popover.css';  import '@poadio/ui-core/colorpicker.css';

API

import { PoadButton, PoadField, PoadInput, PoadSwitch, UiI18nProvider, useUiI18n, UI_FR } from '@poadio/ui-react';

<UiI18nProvider locale="fr-FR" messages={UI_FR}>        {/* défaut : anglais (UI_EN) */}
  <PoadSwitch label="Wi-Fi" checked={on} onCheckedChange={setOn} />          {/* contrôlé */}
  <PoadSwitch aria-label="Bluetooth" defaultChecked onCheckedChange={save} /> {/* non contrôlé */}

  <PoadButton severity="danger" variant="outline" size="sm" loading={busy} onClick={remove}>Delete</PoadButton>

  <PoadField label="Email" hint="We never share it" error={errors.email} required optional>
    <PoadInput type="email" value={email} onChange={(e) => setEmail(e.target.value)} />
  </PoadField>

  <PoadSelect options={runtimes} optionLabel="name" optionValue="id" value={id} onChange={setId}   {/* contrôlé */}
    placeholder="Runtime" filter clearable renderOption={(r, { selected }) => <b>{r.name}</b>} />
  <PoadSelect options={['S', 'M', 'L']} defaultValue="M" onChange={save} aria-label="Size" />   {/* non contrôlé */}
</UiI18nProvider>

| Composant | Props (en plus de celles de l'élément natif) | ref | className et autres props | | --- | --- | --- | --- | | PoadSwitch | checked / defaultChecked, onCheckedChange(checked), disabled, readOnly, label, aria-label, size (sm | md), labelPosition (left | right), id, children | le <button role="switch"> | racine <span class="poad-switch"> | | PoadButton | severity (primary … ghost), variant (solid | outline | text), size (sm | md | lg), loading, disabled, icon, block, pressed | le <button> | le <button> | | PoadField | label, hint, error, required, disabled, inline, size, optionalText, optional (mention du catalogue), plain, id (du contrôle) | la racine <div class="poad-field"> | idem | | PoadInput | size, invalid, mono ; value + onChange ou defaultValue comme un <input> | l'<input> | l'<input> | | PoadIcon | name (jeu nommé, alias compris), size, strokeWidth, label (sinon décorative), title, spin, filled, flip, rotate ; PoadIconProvider (subset, icons, aliases, registry) | racine <span class="poad-icon"> | idem | | PoadBadge | value, max, severity, dot, size, aria-label | <span> | idem | | PoadTag | value / children, severity, dot, icon, rounded, size | <span> | idem | | PoadChip | label, icon, image, avatarText, removable, selected, disabled, clickable, size, severity, onRemove(), onClick(e) | <span> | idem | | PoadAvatar / PoadAvatarGroup | src, text, icon, size, shape, color, label / max, size, moreColor (enfants directs PoadAvatar) | <span> | idem | | PoadDivider, PoadSkeleton | vertical, dashed, align, children / width, height, shape, lines, animation, lastWidth | racine | idem | | PoadProgress, PoadSpinner | value, max, indeterminate, severity, size, showValue, striped, label, aria-label / size, strokeWidth, severity, aria-label (défaut : catalogue) | racine | idem | | PoadMeter | values, min, max, unit, orientation, showLabels, labelPosition, size, showRemaining, remainingLabel, aria-label, renderLabel | racine | idem | | PoadMessage | severity, text / children, icon ('' : aucune), closable, variant, size, open (contrôlé), onClose() | racine | idem | | PoadCard | header, subheader, headerContent, actions, footer, children, hoverable, flat, compact, padding (→ --_pad) | racine | idem | | PoadPanel | header / headerContent, toggleable, collapsed / defaultCollapsed, onCollapsedChange, variant, flat, actions, footer | racine | idem | | PoadFieldset | legend / legendContent, toggleable, collapsed / defaultCollapsed, onCollapsedChange, children | racine <div class="poad-fieldset"> | idem | | PoadCheckbox | checked / defaultChecked, onCheckedChange, indeterminate / defaultIndeterminate, onIndeterminateChange, disabled, readOnly, invalid, label, aria-label, id | le <button role="checkbox"> | racine <span class="poad-checkbox"> | | PoadRadioGroup / PoadRadio | value / defaultValue, onValueChange, disabled, orientation, aria-label / value, label, hint, disabled, id | racine | idem | | PoadToggleButton | pressed / defaultPressed, onPressedChange, onLabel, offLabel, onIcon, offIcon, severity, size, disabled, readOnly, aria-label | le <button> | racine <span class="poad-toggle-button"> | | PoadSegmented | options, optionLabel, optionValue, value / defaultValue, onValueChange, multiple, allowEmpty, block, size, shape, disabled, aria-label, renderOption | racine | idem | | PoadButtonGroup | orientation, look, attached, stretch, size, selectable, value / defaultValue, onValueChange, aria-label (enfants directs PoadButton avec value) | racine | idem | | PoadTextarea | celles d'un <textarea> + size, invalid, mono, autosize (dans un PoadField : comme PoadInput) | le <textarea> | idem | | PoadNumber | value / defaultValue (number \| null), onValueChange, onFocusChange, min, max, step, decimals, locale (défaut : celle du fournisseur), prefix, suffix, placeholder, showButtons, size, invalid, disabled, readOnly, aria-label, id | l'<input> | racine <span class="poad-number"> | | PoadPassword | value / defaultValue, onValueChange, visible / defaultVisible, onVisibleChange, toggleMask, feedback, invalid, disabled, placeholder, autoComplete, aria-label, id, name | l'<input> | racine <div class="poad-password"> | | usePoadMask(options) | mask / preset, slotChar, unmask, autoClear, value / defaultValue, onValueChange, ref → { inputProps, complete } (à étaler sur un PoadInput ou un <input>) | — | — | | usePoadKeyFilter(filter, { validateOnly }) | int | num | alpha | alphanum | hex | email | RegExp → { inputProps, valid(value) } | — | — | | PoadRating | value / defaultValue, onValueChange, max, allowHalf, clearable, icon, size, severity, showValue, disabled, readOnly, aria-label | l'élément role="slider" | racine <span class="poad-rating"> | | PoadSlider | value / defaultValue (number ou [début, fin]), onValueChange, onChange (fin de geste), onSliding, onSlideStart, onSlideEnd, min, max, step, range, orientation, lazy, showValue, formatValue, marks, showTicks, size, severity, label, aria-label, invalid, disabled, readOnly, id | racine | racine <div class="poad-slider"> | | PoadInplace | display, children (l'éditeur), active / defaultActive, onActiveChange, onActivate, onDeactivate, closable, disabled, closeOnEscape, closeOnBlur, showIcon, aria-label | — | racine <span class="poad-inplace"> |

| PoadTooltip | content, placement (top | bottom | left | right), delay, hideDelay, disabled, maxWidth, event (hover | focus | both), className (sur .poad-tooltip), children (UN élément, qui garde ses gestionnaires et sa ref et reçoit aria-describedby) | celle de l'enfant | — | | PoadPopover | trigger (élément cloné : bascule, aria-haspopup / aria-expanded / aria-controls) ou anchor (ref d'un élément de l'application), open / defaultOpen, onOpenChange, placement, align, offset, dismissOnClickOutside, closeOnEscape, focusTrap, showArrow, hasBackdrop, width, minWidth, mobile (popover | sheet), sheetTitle, className, id, children | — | — | | PoadColorpicker | value / defaultValue (texte CSS ou null), onChange, format (hex | rgb | hsl), alpha, inline, presets, placeholder, clearable, invalid, disabled, size, aria-label, onOpenChange | le <button class="cp-trigger"> | racine <div class="poad-colorpicker"> |

Flottants (niveau 3) : une couche interne commune (floating.tsx, non exportée) les pose — useFloating (placement d'ui-core : retournement, poussée, flèche, droite à gauche ; replacé au défilement et au redimensionnement), useDismiss (appui extérieur), useFocusTrap (piège d'ui-core), useScrollLock, usePresence (animations de sortie) et PoadSheet (feuille basse : même DOM que celle d'Angular, glisser pour fermer). Pas de portail : le flottant est rendu dans le composant, en position: fixed — rien à créer dans document.body (rendu serveur, hydratation), l'arbre DOM suit l'arbre React (évènements, contains(), tests) ; un ancêtre transformé (transform, filter, contain), qui devient le bloc conteneur des éléments fixes, est détecté et compensé, mais un tel ancêtre qui coupe (overflow) coupera aussi le flottant. PoadTooltip rend son info-bulle juste après son enfant (un frère dans le DOM).

Les masques et le filtre de touches sont des crochets (usePoadMask, usePoadKeyFilter) là où Angular a des directives sur <input>.

Non porté à ce niveau : la directive [poadBadge] d'Angular (pastille posée sur un autre élément), et le marquage poad-touch (densité tactile) posé sur <html> par un service d'Angular — en React, l'application pose la classe. | PoadSelect | options (primitives ou objets), optionLabel / optionValue (null : l'objet) / optionDisabled / optionHint / optionIcon / optionGroupLabel / optionGroupChildren, value / defaultValue, onChange(value), compareWith, dataKey, placeholder, filter, filterPlaceholder, filterBy, autofocusFilter, clearable, loading, emptyMessage, emptyFilterMessage, size, invalid, disabled, readOnly, panelMaxHeight, aria-label, mobile (auto | sheet | popover), sheetTitle, renderOption, renderValue, renderEmpty, renderIcon, header, footer, onOpenChange, onFilter, onClear, onFocusChange, id | le déclencheur role="combobox" | racine <div class="poad-select"> | | UiI18nProvider | locale, messages | — | — | | useUiI18n() | → { locale, messages, t(ref, params?), text(override, ref, params?) } | | |

onCheckedChange n'est appelé que pour un geste de l'utilisateur (comme (changed) en Angular), jamais quand checked change. Dans un PoadField, PoadInput reçoit son id (cible du libellé), aria-describedby (l'aide, ou l'erreur qui la remplace) et aria-invalid ; un aria-describedby donné par l'application est gardé.

PoadSelect est la liste déroulante de poad-select (une valeur) : même clavier (flèches, Début, Fin, Page↑ / Page↓, Entrée, Espace, Échap, Tab, Suppr si clearable, recherche au clavier), mêmes attributs ARIA (combobox / listbox), même DOM. Le panneau est posé par la couche flottante interne (mêmes positions que l'overlay du CDK d'Angular), mesuré après rendu (rien sur le serveur), replacé au défilement et au redimensionnement, fermé au clic extérieur. Sous 768 px (mobile="auto") ou avec mobile="sheet", il s'ouvre en feuille basse (PoadSheet, comme poad-sheet d'Angular : titre, croix, fond, glisser la poignée pour fermer, piège à focus — Tab reste dans la feuille —, défilement de la page bloqué, focus rendu au déclencheur). onChange n'est appelé que pour un geste de l'utilisateur, et seulement si la valeur change.

Comment c'est fait

Le modèle est celui du socle (voir @poadio/ui-core) : la logique et le style sont dans ui-core, ce paquet ne fait que le gabarit.

// switch.tsx, l'essentiel : la machine décide, React garde la valeur.
const state = { checked: controlled ? !!checked : inner, disabled: !!disabled, readonly: !!readOnly };
const control = switchControlProps(state, { id, label, ariaLabel });       // attributs du <button>
const toggle = () => {
  const next = switchTransition(state, { type: 'toggle' });
  if (next === state) return;                                             // geste refusé par le socle
  if (!controlled) setInner(next.checked);
  onCheckedChange?.(next.checked);
};

Développer

bun install              # à la racine du dépôt
bun run test             # vitest + Testing Library (jsdom) : composants et banc de conformité
bun run test:ssr         # vitest dans Node SANS DOM : tout le paquet chargé et rendu par react-dom/server
bun run typecheck        # tests compris
bun run i18n:check       # garde « aucun texte en dur » (JSX compris)
bun run build            # tsc → dist/ (JS ESM + .d.ts + cartes ; 'use client' conservé en tête des fichiers)

Exemple Next.js minimal (App Router, rendu serveur) : examples/next-minimal.

Licence MIT.