Form components and hooks for building validated, structured forms in Geeks React applications.
yarn add @geeks-react-components/forms
# or
npm install @geeks-react-components/formsPeer dependencies: react (>=18), react-dom (>=18).
Dependencies: Uses @geeks-react-components/core and @geeks-react-components/utils (e.g. for form helpers and validation).
| 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 |
| Hook | Description |
|---|---|
| useForm | Form state, validation, and submission handling |
| Helper | Description |
|---|---|
| createDottedKeyObject | Build objects from dotted key paths |
| createObjectFromDottedKeys | Build objects from dotted keys (nested structure) |
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.
yarn build– Build the packageyarn test– Run testsyarn lint– Lint sourceyarn watch– Build in watch mode
MIT © Geeks Ltd