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

@rapidmx/react-shared

v0.22.0

Published

A library containing platform-agnostic components/data/business-logic for RapidMX's React frontends.

Readme

RapidMX: React Shared

CI Coverage Status npm version

A library containing platform-agnostic components/data/business-logic for RapidMX's React frontends.

This library is used by:

rapidmx/server's own server-rendered pages, @rapidmx/web-client, and @rapidmx/electron-client.

This package is deliberately framework-free beyond React itself — no router, no HTTP client, no state management library. src/ is organized by feature/system, mirroring @rapidmx/restapi's own src/<feature>/ convention: mail/, calendar/, contacts/, tasks/, admin/, branding/, search/, auth/, and util/ for the small set of things every feature depends on (api.ts's apiFetch(), apiQuery.ts's pagination helper, dateInput.ts, useIsMobile.ts, clipboard.ts's copyTextToClipboard() and its useCopyToClipboard.ts hook). Each *Api.ts module is a thin fetch wrapper around one @rapidmx/restapi resource, and a handful of use* hooks and pure utilities (recurrence expansion, vCard/ICS helpers, emoji data, calendar color assignment, mail/mailAddress.ts's Name <address> formatting) back the UI components each consumer builds independently. mail/pushClient.ts is the one real-time connection a tab keeps to the server's /push WebSocket (subscribe to folder/mailbox uids, reconnect with backoff, close on sign-out) - a consumer must still poll, since events published while it was disconnected are never replayed.

src/components/ holds genuinely generic UI primitives — ones with no RapidMX/webmail-domain knowledge baked in — usable by any consumer: buttons/Button+CopyButton, feedback/Alert+Skeleton, forms/FormField, overlays/Modal+Drawer+PopoverPortal, avatar/ContactAvatar, pickers/MiniDatePicker, and navigation/BottomTabBar. Domain-specific components (calendar views, mail compose, contact/task/admin UI, etc.) stay in @rapidmx/web-client, which depends on this package rather than the other way around.

Usage

Every module is published as its own subpath import — there is no single barrel/root export — so a consumer only pulls in the modules it actually uses:

import { apiFetch, configureApiBaseUrl } from "@rapidmx/react-shared/util/api.js";
import { getMailboxes } from "@rapidmx/react-shared/mail/mailApi.js";
import { useSessionRefresh } from "@rapidmx/react-shared/auth/session.js";
import Button from "@rapidmx/react-shared/components/buttons/Button.js";

apiFetch() targets a same-origin relative path (/api/...) by default, matching every consumer that's server-rendered or otherwise served from the same origin as the API it calls. A consumer whose own origin genuinely differs from the RapidMX server's — e.g. @rapidmx/electron-client's renderer — calls configureApiBaseUrl() once at startup to target an absolute origin instead; see src/util/api.ts for the CORS/cookie configuration that requires on the server side.

Status

This library is under active development. It was extracted verbatim from rapidmx/server's apps/shared/lib so it could be versioned and consumed independently by @rapidmx/web-client and @rapidmx/electron-client — see CHANGELOG.md for the split's own history.