Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

@geeks-react-components/forms

Form components and hooks for building validated, structured forms in Geeks React applications.

Installation

yarn add @geeks-react-components/forms
# or
npm install @geeks-react-components/forms

Peer dependencies: react (>=18), react-dom (>=18).
Dependencies: Uses @geeks-react-components/core and @geeks-react-components/utils (e.g. for form helpers and validation).

Components

Component Description
Form Main form wrapper with validation and field handling
Fields Field set / grouped fields
Actions Form actions (submit, cancel, etc.)
WizardForm Multi-step wizard form

Hooks

Hook Description
useForm Form state, validation, and submission handling

Helpers

Helper Description
createDottedKeyObject Build objects from dotted key paths
createObjectFromDottedKeys Build objects from dotted keys (nested structure)

Usage

import {
  Form,
  Fields,
  Actions,
  useForm,
  WizardForm,
} from '@geeks-react-components/forms';

// Form with useForm
function MyForm() {
  const form = useForm({
    initialValues: { name: '', email: '' },
    onSubmit: (values) => console.log(values),
  });

  return (
    <Form form={form}>
      <Fields>
        {/* field definitions */}
      </Fields>
      <Actions />
    </Form>
  );
}

// Wizard form
<WizardForm steps={[...]} onComplete={handleComplete} />

Types are exported for form config, field schemas, and validation. See the package exports and Storybook for full API and examples.

Package Scripts

  • yarn build – Build the package
  • yarn test – Run tests
  • yarn lint – Lint source
  • yarn watch – Build in watch mode

License

MIT © Geeks Ltd