wolfzer44 / ninti

Create ReactJS uncontrolled form structures with nested fields.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NINTI 🚀

Tiny lib to help work with forms on React

Installation

Just add ninti to your project:

yarn add ninti

Basics

Ninti exposes two default form elements: <Form /> and <Input />.

import React from "react";
import { Form, Input } from "ninti";

function App() {
  function handleSubmit(data) {
    console.log(data);

    /**
     * {
     *   email: 'email@example.com',
     *   password: '123456'
     * }
     */
  }

  return (
    <Form onSubmit={handleSubmit}>
      <Input name="email" />
      <Input name="password" type="password" />

      <button type="submit">Sign in</button>
    </Form>
  );
}

About

Create ReactJS uncontrolled form structures with nested fields.


Languages

Language:TypeScript 50.7%Language:HTML 28.5%Language:JavaScript 14.8%Language:CSS 6.1%