A React component for building forms with built-in data collection and validation. Version 0.1.5 is the latest stable release, with no recent updates indicating active development. Integrates with the Validator library for common validations and supports custom validation functions, initial data population, multiple validation rules per input, and multiple validation error messages. Differentiates by offering a declarative component approach with props for submit and validation callbacks, catering to React class components with refs for form state access.
npm install atomic-formNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Minimal example of a React form using AtomicForm with email validation and submit handler.
Replace string refs with callback refs or React.createRef in your components.
Convert React.createClass to an ES6 class extending React.Component.
Use import AtomicForm from 'atomic-form' (default import).
Use var AtomicForm = require('atomic-form').default;Always wrap validation objects in an array: validate={[{ ... }]}Use ref to access formData method when needed.
Replace with: import AtomicForm from 'atomic-form'
Use: var AtomicForm = require('atomic-form').default;Wrap in array: validate={[{ message: '...', validate: '...' }]}Check if this.state.validations exists before accessing specific field.
Use callback refs or React.createRef: ref={this.emailRef}