@splatterxl/chakra-forms
TypeScript icon, indicating that this package has built-in type declarations

1.9.0 • Public • Published

chakra-forms

Simple reusable form library for my projects.

Installation

yarn add @splatterxl/chakra-forms

Example

const MyForm = () => {
  return (
    <Form
      id="login"
      onSubmit={(values) => {
        console.log(values.username, values.password);
      }}
      initialFocus="username"
    >
      <FormBody>
        <FormField
          as={TextInput}
          id="username"
          label="Email"
          defaultValue="test@example.com"
          autocomplete={{
            type: FormInputAutocompleteTypes.USERNAME,
          }}
          schema={{ email: true }}
          required
        />
        <FormField
          as={PasswordInput}
          id="password"
          label="Password"
          autocomplete={{
            type: FormInputAutocompleteTypes.CURRENT_PASSWORD,
          }}
          required
        />
      </FormBody>
    </Form>
  );
};

Documentation

Dependents (0)

Package Sidebar

Install

npm i @splatterxl/chakra-forms

Weekly Downloads

12

Version

1.9.0

License

MIT

Unpacked Size

6.65 MB

Total Files

127

Last publish

Collaborators

  • splatterxl