0.13.18 • Published 1 year ago

sigform v0.13.18

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

sigform

Nestable react form UI for allowing developer to construct complex form UI without hassle.

# For npm
npm i react sigform

# For yarn
yarn add react sigform

How to use

SEE: example For how to use it in Next.js project.

import { sigfield } from "sigform";
import React from "react";

export const TextInput = sigfield<{}, string>((props, ref) => {
  const { name, setValue, value } = props;

  return (
          <div className="p-4 bg-red-400" ref={ref}>
            <input
                    name={name}
                    type="text"
                    onChange={(e) => setValue(e.target.value)}
                    value={value}
            />
          </div>
  );
});


// And use it with form wrapper (SigForm).
<SigForm
    onChange={(value, helpers) => {
      console.log("changed!", JSON.stringify(value, null, 2));
    }}
    onSubmit={(data) => {
      console.log("submit!", JSON.stringify(data, null, 2));
        // Will output this data
        // { "email": "hoge@example.com" }
    }}
>
    <TextInput name="email" defaultValue="hoge@example.com" />

    <button type="submit" className="p-1 border rounded">submit</button>
</SigForm>

License

MIT, see the LICENSE file.


With Thanks to awesome OSS developers for inspiration. unform/unform / preactjs/signals / jamiebuilds/unstated-next / immerjs/immer

0.13.18

1 year ago

0.13.17

1 year ago

0.13.16

1 year ago

0.13.15

1 year ago

0.13.14

1 year ago

0.13.13

1 year ago

0.13.12

1 year ago

0.13.11

1 year ago

0.13.9

1 year ago

0.13.10

1 year ago

0.13.7

1 year ago

0.13.8

1 year ago

0.13.6

1 year ago

0.13.5

1 year ago

0.13.3

1 year ago

0.13.4

1 year ago

0.13.1

1 year ago

0.13.2

1 year ago

0.12.7

1 year ago

0.12.5

1 year ago

0.12.4

1 year ago

0.12.2

1 year ago

0.12.3

1 year ago

0.12.0

1 year ago

0.12.1

1 year ago

0.11.4

2 years ago

0.11.5

2 years ago

0.11.6

2 years ago

0.11.2

2 years ago

0.11.3

2 years ago

0.11.0

2 years ago

0.11.1

2 years ago

0.10.20

2 years ago

0.10.18

2 years ago

0.10.19

2 years ago

0.10.16

2 years ago

0.10.17

2 years ago

0.10.15

2 years ago

0.10.14

2 years ago

0.10.13

2 years ago

0.10.12

2 years ago

0.10.11

2 years ago

0.10.10

2 years ago

0.10.9

2 years ago

0.10.7

2 years ago

0.10.6

2 years ago

0.10.5

2 years ago

0.10.4

2 years ago

0.10.3

2 years ago

0.10.2

2 years ago

0.10.1

2 years ago

0.10.0

2 years ago

0.9.0

2 years ago