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

routelit-client

v0.5.5

Published

Routelit React Client for building data and web applications in python over http.

Readme

Routelit React client

Routelit

This is the react client for the Routelit. It is not supposed to be used alone, but rather as part of the python Routelit library. And just if you want to build custom components.

Routelit is an agnostic library for building data and web applications in python over http.

This library contains core and basic components.

Core components

  • container
  • dialog
  • form
  • fragment
  • image
  • link
  • markdown
  • headings
  • checkbox (with label)
  • single-checkbox
  • checkbox_group
  • radio (group)
  • select
  • textarea (with label)
  • single-textarea
  • text_input (with label)
  • single-text-input
  • button
  • expander
  • heading
  • title
  • header
  • subheader

Public API (exports from src/lib.ts)

  • This section documents everything you can import from src/lib.ts (and what is exposed on window).

Globals

  • React: Re-exported and also attached to window.React for non-bundled environments.
  • ReactDOM: Re-exported and also attached to window.ReactDOM.
  • jsxRuntime: Re-exported and attached to window.jsxRuntime with jsx, jsxs, and Fragment for JSX runtime needs.
  • RoutelitClient: Singleton attached to window.RoutelitClient that aggregates the most common API surface.
    • Example:
      const { manager, componentStore, renderApp } = window.RoutelitClient!;
      renderApp("root");

Singletons

  • manager (RouteLitManager): Central event/state manager. Handles routelit:event dispatch, navigation, throttled action batching, and subscriptions to loading and error state.
  • componentStore (ComponentStore): Registry used by the renderer and components. Pre-registered with the core components listed above; you can extend it with componentStore.register(name, Component) and then use that name from the server.

Rendering

  • renderApp(rootId?: string): Mounts the app (default element id is root).

Hooks (context-aware)

  • useDispatcherWith(id, type): Returns a (data: Record<string, unknown>) => void that dispatches a custom Routelit event { id, type, ...data }.
  • useDispatcherWithAttr(id, type, attr): Returns a (value: unknown) => void that dispatches { id, type, [attr]: value }.
  • useFormDispatcher(id, type): Like useDispatcherWith, but includes the current formId in the payload. Useful inside form controls.
  • useFormDispatcherWithAttr(id, type, attr): Like useDispatcherWithAttr, but includes formId.
  • useIsLoading(): Returns a boolean reflecting combined loading state (fragment or app-level).
  • useError(): Returns the last Error (if any) bubbled from the manager chain.

Hooks (UI utilities)

  • useLinkClickHandler({ id, href, replace, isExternal }): Returns an anchor onClick handler that dispatches a navigate event. Prevents default for internal links; lets external links proceed.
  • useRLInlineElement(props, elementKeys): Converts inline element descriptors on props to rendered elements using the ComponentStore (e.g., slots like leftIcon, rightIcon).
  • useRLCallbackAttributes(props, rlCallbackAttrs): Converts string function bodies found on props at the listed attribute names into real callbacks and returns them. Note: only use with trusted input.

Higher-order components (HOCs)

  • withSimpleComponent(Component, props?): Wraps any element/component, merging optional props and mapping any rlInlineElementsAttrs into real inline elements.
    • Example:
      const Title = withSimpleComponent("h1", { className: "title" });
  • withEventDispatcher(Component, options?): Attaches an event handler that dispatches a Routelit event (defaults: rlEventName="click", rlEventAttr="onClick"). Works well for buttons.
    • Example:
      const Button = withEventDispatcher("button", { type: "button" });
      // <Button id="save">Save</Button>
  • withValueEventDispatcher(Component, options?): Attaches a value-change handler that dispatches { [rlValueAttr]: value } (defaults: change/onChange/value).
    • Examples:
      const TextInput = withValueEventDispatcher("input", { type: "text" });
      const Checkbox = withValueEventDispatcher("input", {
        type: "checkbox",
        rlValueAttr: "checked",
        rlEventValueGetter: (e) => e.currentTarget.checked,
      });
  • withInputValueEventDispatcher(Component, options?): For text inputs/textareas; dispatches a change with value on onBlur or when pressing Enter. Defaults wire up onBlur/onKeyDown and read from defaultValue.
    • Example:
      const TextArea = withInputValueEventDispatcher("textarea");
  • withCallbackAttributes(Component, { rlCallbackAttrs? }): Converts string callbacks on the listed attribute names into real functions and forwards them to the wrapped component.