1.1.1 • Published 11 months ago

@najwer23snacks/form v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

The Form component is a reusable React functional component designed to handle form submissions in a structured and efficient manner. It encapsulates the logic for managing form data and provides a clean interface for developers to work with.

Install

yarn add @najwer23snacks/form --dev
npm install @najwer23snacks/form --save-dev

Example

import { Form } from "@najwer23snacks/form";

export const Example = () => {

    const handleOnSubmit = (formData: Record<string, object>) => {
      console.log("Form:", formData)
    };

    return (
      <>
        <Form onSubmit={handleOnSubmit}>
          <div>
            <div><label>Name:</label></div>
              <input type="text" id="numberInput" name="name" className='error' />
            </div>

          <br />

          <div>
            <div><label>Password:</label></div>
            <input type="text" id="password" name="password" />
          </div>

          <br />

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

Let's connect!

dev.to badge dev.to badge twitter badge dev.to badge dev.to badge dev.to badge

1.1.1

11 months ago

1.1.0

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago