damiano-carradori / react-forms-crane

Build your Form with the minimal effort
https://www.npmjs.com/package/react-forms-crane
MIT License
2 stars 0 forks source link
context-api form forms react

React Forms-crane 🏗️ Build Status

npm bundle size GitHub package.json version (branch) GitHub package.json version (branch)

Check the library on Storybook

Installation

Latest

$ npm install react-forms-crane

With hooks

$ npm install react-forms-crane@hooks

How to use

import React from "react";
import Form, { Text, Submit } from "react-forms-crane";

function App() {
    const onSubmit = ({ firstName, lastName }) => {
        alert(`Hello ${firstName} ${lastName}!`);
    };

    return (
        <Form onSubmit={onSubmit}>
            <Text name="firstName" placeholder="Insert your first name" />
            <Text name="lastName" placeholder="Insert your last name" />
            <Submit />
        </Form>
    );
}

export default App;

Available Fields

Missing fields

Other elements