Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rescriptbr/reform

πŸ“‹ Reasonably making forms sound good
https://github.com/rescriptbr/reform

forms react react-form reasonml reform rescript rescript-forms rescript-react rescript-react-form typed-form

Last synced: about 2 months ago
JSON representation

πŸ“‹ Reasonably making forms sound good

Awesome Lists containing this project

README

        

[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors)
[![npm version](https://badge.fury.io/js/@rescriptbr%2Freform.svg)](https://badge.fury.io/js/@rescriptbr%2Freform)







Documentation β€’
Installation β€’
Getting started β€’
Live demo



## Installation πŸ“¦

```
yarn add @rescriptbr/reform @rescriptbr/reschema
```

Then add it to bsconfig.json

```
"bs-dependencies": [
"@rescriptbr/reform",
"@rescriptbr/reschema"
]
```

Then add lenses-ppx

```
yarn add lenses-ppx -D
```

And update your bsconfig.json with `ppx-flags`

```
"ppx-flags": [
"lenses-ppx/ppx"
]
```

## Why? πŸ’‘

As you might know, you can use any existing React / JavaScript libraries with ReScript, including form libraries like Formik, react-hook-form, Final Form, since you install or create bindings for these libraries. ReForm is not a set of bindings for an existing form library, it was created from scratch to use with ReScript and React.

Code that deals with strongly typed forms can quickly become walls of repeated text. We created ReForm to be both deadly simple and to make forms sound good leveraging ReScript's powerful typesytem. Even the schemas we use are nothing more than constructors built-in in the language itself with a small size footprint.

## Features ⚑

- Hook API
- Schema API
- Type safe, `handleChange` properly infers the value of the field it is handling
- Context Provider
- Field component
- Validation strategy, OnDemand and OnChange

## Alternatives πŸ”₯

- [Formality](https://github.com/alexfedoseev/re-formality)

## Support πŸš€

🌍 We usually hang out at https://forum.rescript-lang.org/ so feel free to ask anything there.

πŸ‡§πŸ‡· πŸ‡΅πŸ‡Ή Se vocΓͺ Γ© Brasileiro, PortuguΓͺs ou fala portuguΓͺs, vocΓͺ pode entrar contato atravΓ©s do discord do [ReScriptBR](http://discord.com/invite/SSDMNYQ).

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):



Thomas Deconinck

πŸ“– πŸ’»

Gabriel Rubens

πŸ’» πŸ› πŸ€” πŸ–‹ πŸ“–

Lucas Besen

🚧

Jefferson Carvalho

πŸ’»

Luiz Augusto Moratelli

πŸ’»

amythos

πŸ’»

Lalli Nuorteva

πŸ›



Matt

🚧

Kyle Davis

πŸ‘€

Ulugbek Abdullaev

πŸ›

Khoa Nguyen

πŸ’»

Medson Oliveira

πŸ’» πŸ€”

Ana Luiza Portello Bastos

πŸ“–

Freddy Harris

πŸ›



arthur

πŸ“– πŸ’»

Marcos Oliveira

πŸ“– 🎨

Celso Bonutti

πŸ’»

Jason Smythe

πŸ’» πŸ“–

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!