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

react-rondo

v0.0.1

Published

Simple form library for working with forms in React

Downloads

3

Readme

Rondo

A simple library for writing forms in React. Rondo aims to do as little as possible, leveraging the browsers built in form capabilities to do the heavy lifting. This allows us to build powerful forms with little code.

Resources

Rondo uses native web APIs wherever possible. Here are a couple you will run in to when using the library.

  • FormData - an object that captures your forms data.
  • ValidityState - an interface that represents the reasons a field might be invalid.

Installation

yarn add react-rondo

Usage

import {useForm} from 'react-rondo';

function App() {
  const {Form} = useForm({
    async onSubmit(formData) {
      await fetch('/api', {
        method: 'POST',
        body: formData
      })
    })
  });

  return (
    <Form>
      <label>
        Email
        <input
          type="email"
          name="email"
        />
      </label>

      <input type="submit" />
    </Form>
  );
}

Validation

Rondo leverages the constraint validation API to provide powerful validation right out of the box. All you need to do is decorate your fields with validation attributes such as required, pattern, or maxlength. From there, rondo will gather all of your forms errors and return them in an errors object.

The browser provides a ton of built in error messages for all types of scenarios, but if you'd like to override some of these defaults you can do so with the customMessage option. Here you can provide a function that returns a custom message for each of your fields. This function will be passed a ValidityState object to let you know which validations have been triggered.

import {useForm} from 'react-rondo';

function App() {
  const {Form, errors} = useForm({
    customMessage: {
      email(validity) {
        if (validity.valueMissing) {
          return 'Make sure to include an email address';
        }

        if (validity.typeMismatch) {
          return 'Please enter a valid email address';
        }
      }
    }
    async onSubmit(formData) {
     // Handle api call
    })
  });

  return (
    <Form>
      <label>
        Email
        <input
          required
          type="email"
          name="email"
          aria-invalid={'email' in errors}
          aria-describedby={'email' in errors ? 'emailError' : undefined}
        />

        {'email' in errors ? (
          <span id="emailError">{errors.email.message}</span>
        ) : null}
      </label>

      <input type="submit" />
    </Form>
  );
}

Cancelling inflight form submissions

Rondo makes it easy to avoid overlapping form submissions. All you need to do to take advantage of this is pass the signal to your fetch call. Rondo uses an AbortController under the hook to manage this.

import {useForm} from 'react-rondo';

function App() {
  const {Form} = useForm({
    async onSubmit(formData, signal) {
      const response = await fetch('/api', {
        method: 'POST',
        body: formData,
        signal,
      });

      if (response.ok) {
        return {
          status: 'success',
        };
      } else {
        return {
          stutus: 'failed',
          errors: {},
        };
      }
    },
  });

  return (
    <Form>
      <label>
        Email
        <input type="email" name="email" />
      </label>

      <input type="submit" />
    </Form>
  );
}