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

xote

v4.1.0

Published

![NPM Version](https://img.shields.io/npm/v/xote) ![npm bundle size](https://img.shields.io/bundlephobia/min/xote) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/xote)

Readme

xote

NPM Version npm bundle size npm bundle size

Xote is a lightweight UI library for ReScript that combines fine-grained reactivity with a minimal component system. Built on rescript-signals, it provides declarative components, JSX support, and signal-based routing for building reactive web applications.

Features

  • Reactive Components: Declarative UI building with JSX support and direct DOM updates
  • Signal-based Reactivity: Powered by rescript-signals for automatic dependency tracking
  • Fine-grained Updates: Direct DOM manipulation without virtual DOM diffing
  • Signal-based Router: SPA navigation with pattern matching and dynamic parameters
  • Lightweight: Minimal runtime footprint (~18kb minified)
  • Type-safe: Full ReScript type safety throughout

Getting Started

Installation

npm install xote
# or
yarn add xote
# or
pnpm add xote

Then, add it to your ReScript project’s dependencies in rescript.json:

{
  "bs-dependencies": ["xote"]
}

What Makes Xote Unique?

While Xote uses rescript-signals for reactive primitives (Signal, Computed, Effect), it adds:

  • Component System: A minimal but powerful component model with JSX support
  • Direct DOM Updates: Fine-grained reactivity that updates DOM elements directly, no virtual DOM
  • Signal-based Router: Client-side routing with pattern matching and reactive location state
  • Reactive Attributes: Support for static, signal-based, and computed attributes on elements
  • Automatic Cleanup: Effect disposal and memory management built into the component lifecycle

Xote focuses on clarity, control, and performance. The goal is to offer precise, fine-grained updates and predictable behavior with minimal abstractions.

Quick Example

Using JSX

open Xote

module App = {
  let make = () => {
    // Create reactive state
    let count = Signal.make(0)

    // Event handler
    let increment = (_evt: Dom.event) => Signal.update(count, n => n + 1)

    // Build the UI with JSX
    <div>
      <h1> {Component.text("Counter")} </h1>
      <p>
        {Component.textSignal(() => `Count: ${Signal.get(count)->Int.toString}`)}
      </p>
      <button onClick={increment}>
        {Component.text("Increment")}
      </button>
    </div>
  }
}

// Mount to the DOM
Component.mountById(<App />, "app")

Core Concepts

Reactive Primitives (from rescript-signals)

  • Signal: Reactive state container - Signal.make(value)
  • Computed: Derived reactive value that updates automatically - Computed.make(() => ...)
  • Effect: Side-effect functions that re-run when dependencies change - Effect.run(() => ...)

All reactive primitives feature automatic dependency tracking - no manual subscriptions needed.

Xote Features

  • Component: Declarative UI builder with JSX syntax and function-based APIs
  • Router: Signal-based navigation for SPAs with pattern matching and dynamic routes

Component Features

  • JSX syntax: Use HTML tags like <div>, <button>, <input>
  • Props: Standard HTML attributes like class, id, style, value, placeholder
  • Event handlers: onClick, onInput, onChange, onSubmit, etc.
  • Reactive content: Wrap reactive text with Component.textSignal(() => ...)
  • Component functions: Define reusable components as functions that return JSX

Xote.Router Features

  • Initialization: Call Router.init() once at app start
  • Imperative navigation: Use Router.push() and Router.replace() to navigate programmatically
  • Declarative routing: Define routes with Router.routes() and render components based on URL patterns
  • Dynamic parameters: Extract URL parameters using :param syntax (e.g., /users/:id)
  • Navigation links: Use Router.link() for SPA navigation without page reload
  • Reactive location: Access current route via Router.location signal

Examples

Check some examples of applications built with Xote at https://brnrdog.github.io/xote/demos/.

Running Examples Locally

To run the example demos locally:

  1. Clone the repository:
git clone https://github.com/brnrdog/xote.git
cd xote
  1. Install dependencies:
npm install
  1. Compile ReScript and start the dev server:
npm run res:dev  # In one terminal (watches ReScript files)
npm run dev      # In another terminal (starts Vite dev server)
  1. Open your browser and navigate to http://localhost:5173

The demo app includes a navigation menu to explore all examples interactively.

Documentation

Comprehensive documentation with live embedded demos is available at:

https://brnrdog.github.io/xote/

Building Documentation Locally

To build and preview the documentation site:

npm run docs:start

This will build the demos and start the documentation server at http://localhost:3000.

License

LGPL v3