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 πŸ™

Β© 2024 – Pkg Stats / Ryan Hefner

@react-formilicious/core

v2.0.1

Published

Easy to use, modular and simply delicious forms for React. πŸ“

Downloads

3

Readme

@react-formilicious/core npm

Easy to use, modular and simply delicious forms for React. πŸ“

  • Demo: https://patricksachs.github.io/react-formilicious/build
  • Changelog: https://github.com/PatrickSachs/react-formilicious/blob/master/CHANGELOG.md
  • Wiki: https://github.com/PatrickSachs/react-formilicious/wiki
  • Storybook: https://patricksachs.github.io/react-formilicious/core (https://patricksachs.github.io/react-formilicious/bulma for something visual)
  • Install: npm install @react-formilicious/core

Motivation

Form management in React has always been a pain point for me. Not due to the lack of expressiveness, but due to the need of manually having to set up every field with its own event handlers, creating a property for it in the state, and possibly adding quite the amount of case-by-case code if you need adjusted validation per field.

This is fine for one or two fields in an application. If you need dozens of fields, this can quickly become an unmaintainable mess.

react-formilicious intends to fix this issue by providing a simple, yet powerful and extendible solution for both simple, aswell as complex and nested forms.

Feature spotlight

  • Simple - Supply a plain JavaScript object as the form, Formilicious takes care of the rest. No need to handle events, lifecycle, etc. yourself.
  • Extendible - Don't like a default field? Need a customized validator? The entire library is modular, you can easily extend Formilicious to your needs.
  • Asynchronous - A validator needs to contact your server in order to validate a field? Some data needs to be processed before a field can change its value? No problem, Formilicious is asynchronous by default!

Getting started

The core library does not include any fields since they are styling specific. In this quick guide we will be using the Bulma fields. Feel free to check if fields for your favourite framework are available under https://github.com/PatrickSachs/react-formilicious/tree/master/packages.

$ npm install @react-formilicious/core
$ npm install @react-formilicious/bulma
import Form from '@react-formilicious/core';
import combined from '@react-formilicious/core/validators/combined';
import range from '@react-formilicious/core/validators/range';
import required from '@react-formilicious/core/validators/required';
import TextField from '@react-formilicious/bulma/TextField';
import Checkbox from '@react-formilicious/bulma/Checkbox';
import checkForAvailableUsername from './my-own-validators/checkForAvailableUsername';

<Form
  data={{
    name: "Patrick Sachs"
  }}
  onSubmit={data => alert(JSON.stringify(data))}
  elements={[
    {
      type: TextField,
      key: "name",
      name: "πŸ™ƒ Username",
      placeholder: "πŸ™ƒ Enter your name here!",
      validator: combined(
        range({ min: 4, max: 16 }),
        checkForAvailableUsername()
      )
    },
    {
      type: TextField,
      key: "password",
      name: "πŸ”‘ Password",
      mode: "password",
      placeholder: "πŸ”‘ Your super secret password here!",
      validator: range({ min: 5 })
    },
    {
      type: Checkbox,
      key: "tos",
      name: <span>πŸ“„ Accept the <a href="#/tos">TOS</a>?</span>,
      validator: required()
    }
  ]} />

Demo Image

See the react-formilicious wiki and/or the Storybook or the core and bulma library for more information, guides & tutorials!

License

MIT - https://github.com/PatrickSachs/react-formilicious/blob/master/packages/core/LICENSE

Contributing

Always welcome! After cloning the repository make sure to run bootstrap.cmd(Windows only, feel free to open a PR with a SH file πŸ˜ƒ) to get you up and running. watch-all.cmd builds and watches all packages.