Skip to content

damiano-carradori/react-forms-crane

Repository files navigation

React Forms-crane 🏗️ Build Status

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

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

  • Text
  • Checkbox
  • RadioButton
  • Password
  • Select
  • TextArea
  • File
  • Button
  • Submit
  • Reset

Missing fields

  • Search
  • Number
  • Email
  • Hidden
  • Color
  • Image
  • Range
  • Url
  • Date
  • DateTime
  • DateTimeLocal
  • Time
  • Month
  • Week

Other elements

  • Fieldset
  • Legend