Gathering detailed insights and metrics for informed
Gathering detailed insights and metrics for informed
Gathering detailed insights and metrics for informed
Gathering detailed insights and metrics for informed
@utima/ui-informed
Utima UI-Informed based on Utima UI and form library Informed with support for Zod validations.
@informed-iq/request-iq-sdk
This is no longer supported as a standalone module. Please reference https://www.npmjs.com/package/@informed-iq/verify-iq-sdk
react-informed
Form library providing an easy way to create forms with react
@informed-iq/verify-iq-sdk
Please refer to the official informed [technical documentation](https://documentation.informed.iq/) for setup instructions
A lightweight framework and utility for building powerful forms in React applications
npm install informed
Typescript
Module System
Node Version
NPM Version
JavaScript (96.27%)
CSS (2.66%)
TypeScript (0.75%)
HTML (0.32%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
967 Stars
1,718 Commits
179 Forks
14 Watchers
14 Branches
43 Contributors
Updated on Jul 10, 2025
Latest Version
4.66.0
Package Id
informed@4.66.0
Unpacked Size
616.11 kB
Size
102.61 kB
File Count
147
NPM Version
10.8.2
Node Version
20.18.3
Published on
Jul 01, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
60
1
Say hello to the best React form library you have ever used! Informed is an extensive, simple, and efficient solution for creating basic to complex forms in React. Out of the box you get the ability to grab and manipulate values, validate fields, create custom inputs, multi-step forms, array fields, and much much more!
Oh and YES WE USE HOOKS!
npm install --save informed
See for yourself.
By default it comes with native dom inputs that are controlled by informed.
1import { Form, Input, Select, Checkbox, Relevant, Debug } from 'informed'; 2 3const onSubmit = ({ values }) => console.log(values); 4 5const ExampleForm = () => ( 6 <Form onSubmit={onSubmit}> 7 <Input name="name" label="Name" placeholder="Elon" /> 8 <Input name="age" type="number" label="Age" required="Age Required" /> 9 <Input name="phone" label="Phone" formatter="+1 (###)-###-####" /> 10 <Select name="car" label="Car" initialValue="ms"> 11 <option value="ms">Model S</option> 12 <option value="m3">Model 3</option> 13 <option value="mx">Model X</option> 14 <option value="my">Model Y</option> 15 </Select> 16 <Checkbox name="married" label="Married?" /> 17 <Relevant when={({ formState }) => formState.values.married}> 18 <Input name="spouse" label="Spouse" /> 19 </Relevant> 20 <button type="submit">Submit</button> 21 <Debug /> 22 </Form> 23);
informed
was designed to support many important features
[ 'a', 'b' ]
or [ { name: 'Joe', age: 29 }, { name: 'Hope', age: 24 }]
state.values.friends[1].brother.parents.cars[0].model
But what if you dont want the out of the box stuff??
No problem, see example below!
1import { useForm, useField, Relevant, FormState } from 'informed'; 2 3// Step 1. Build your form component --------------------- 4 5const Form = ({ children, ...rest }) => { 6 const { formController, render, userProps } = useForm(rest); 7 8 return render( 9 <form noValidate {...userProps} onSubmit={formController.submitForm}> 10 {children} 11 </form> 12 ); 13}; 14 15// Step 2. Build your input components -------------------- 16 17const Input = props => { 18 const { render, informed, userProps, ref } = useField({ 19 type: 'text', 20 ...props 21 }); 22 const { label, id, ...rest } = userProps; 23 return render( 24 <> 25 <label htmlFor={id}>{label}</label> 26 <input id={id} ref={ref} {...informed} {...rest} /> 27 </> 28 ); 29}; 30 31const Checkbox = props => { 32 const { render, informed, userProps, ref } = useField({ 33 type: 'checkbox', 34 ...props 35 }); 36 const { label, id, ...rest } = userProps; 37 return render( 38 <> 39 <label htmlFor={id}>{label}</label> 40 <input id={id} ref={ref} {...informed} {...rest} /> 41 </> 42 ); 43}; 44 45const ErrorInput = props => { 46 const { render, informed, userProps, fieldState, ref } = useField({ 47 type: 'text', 48 ...props 49 }); 50 const { label, id, ...rest } = userProps; 51 const { showError } = fieldState; 52 const style = showError ? { border: 'solid 1px red' } : null; 53 return render( 54 <> 55 <label htmlFor={id}>{label}</label> 56 <input id={id} ref={ref} {...informed} {...rest} style={style} /> 57 {showError && <small style={{ color: 'red' }}>{fieldState.error}</small>} 58 </> 59 ); 60}; 61 62const Select = props => { 63 const { render, informed, userProps, ref } = useField({ 64 type: 'select', 65 ...props 66 }); 67 const { label, id, children, ...rest } = userProps; 68 return render( 69 <> 70 <label htmlFor={id}>{label}</label> 71 <select id={id} ref={ref} {...informed} {...rest}> 72 {children} 73 </select> 74 </> 75 ); 76}; 77 78// Step 3. Build your forms! --------------------------- 79 80const onSubmit = ({ values }) => console.log(values); 81 82const ExampleForm = () => ( 83 <Form onSubmit={onSubmit}> 84 <Input name="name" label="Name" placeholder="Elon" /> 85 <ErrorInput name="age" type="number" label="Age" required="Age Required" /> 86 <Input name="phone" label="Phone" formatter="+1 (###)-###-####" /> 87 <Select name="car" label="Car" initialValue="ms"> 88 <option value="ms">Model S</option> 89 <option value="m3">Model 3</option> 90 <option value="mx">Model X</option> 91 <option value="my">Model Y</option> 92 </Select> 93 <Checkbox name="married" label="Married?" /> 94 <Relevant when={({ formState }) => formState.values.married}> 95 <Input name="spouse" label="Spouse" /> 96 </Relevant> 97 <button type="submit">Submit</button> 98 <Debug /> 99 </Form> 100);
Informed took the following into consideration when being built:
informed
was designed to be able to handle very complex forms at scale
informed
was designed to be able to write complex forms with very little intuitive code
1<Form onSubmit={onSubmit}> 2 <Input name="name" label="Name" placeholder="Elon" /> 3 <Input name="age" type="number" label="Age" required="Age Required" /> 4 <Input name="phone" label="Phone" formatter="+1 (###)-###-####" /> 5 <Checkbox name="married" label="Married?" /> 6 <Relevant when={({ formState }) => formState.values.married}> 7 <Input name="spouse" label="Spouse" /> 8 </Relevant> 9 <Debug /> 10</Form>
ZERO Dependency: informed
was designed to rely on no other library
JSON Schema: informed
was designed to support rendering forms based on pure JSON
Feature List: informed
was designed to support many important features
[ 'a', 'b' ]
or [ { name: 'Joe', age: 29 }, { name: 'Hope', age: 24 }]
state.values.friends[1].brother.parents.cars[0].model
1const path = 'state.values.friends[1].brother.name';
This project cotains three important directories, src
, vitedocs
, and __tests__
Note: some things were left out as they are not super important or are going to be deprecated or removed in future.
1project_root 2│ 3├── index.d.ts # all of informeds types live here 4│ 5├── src # all of informeds source code lives here ( except types index.d.ts ) 6│ ├── components # React Components 7│ ├── hooks # Hooks 8│ ├── Context.js # Internal Contexts used in this library 9│ ├── debug.js # Basically the https://github.com/visionmedia/debug library but shrunk down 10│ ├── fieldMap.js # Default field adapter, used when working with schema forms 11│ ├── index.js # all external exports ( everything exposed to users ) 12│ ├── ObjectMap.js # internal data structure for manipulating the form state objects 13│ ├── FormController.js # The brains behind the library, this controls basically everything :) 14│ └── utils.js # Any utilities used throughout this project 15│ 16├── vitedocs # All the informed docs build via vite ( instead of storybook which was old way ) 17│ ├── App.jsx # basic react app with react-router 18│ ├── Header # top nav of the docs 19│ ├── hooks # helper hooks for docs 20│ ├── Nav # side nav of the docs 21│ ├── Pages # main level pages of the app 22│ │ ├──ApiReference # Self explanatory :) 23│ │ ├──Examples # Examples of all sorts of usecases 24│ │ ├──GettingStarted # Also Self explanatory :) 25│ │ └──Playground.jsx # Uses Sandpack to allow users to test any of the examples 26│ │ 27│ ├── SideBySide.jsx # helper component for showing code example and output side by side 28│ ├── index.css # documentation styles 29│ ├── prism.css # styles for code blocks 30│ └── ... # other stuff 31│ 32└── __tests__ # extensive unit testing 33 ├── components # tests for informed components 34 ├── hooks # tests for informed hooks 35 ├── ObjectMap.test # tests for the internal data structure 36 ├── Schema.test # tests for usage of JSON schema rendered forms 37 └── utils.test # tests for internal library utilities
FormController
FormController is the brains of informed, it holds the state
object and is responsible for:
ObjectMap
ObjectMap is the internal data structre that is responsible for managing the internal state object. Reads and writes all go through this data structure. Example:
1// State object 2const state = { values: {} }; 3 4// Set the states values first friends brothers age to 30 5ObjectMap.set(state.values, 'friends[0].brothers.age', 30);
useField
useField is the first class citizen of informed, it's responsible for registering a field by name to the FormController.
Though there is not explicitly a component called Context
here the concept is KEY to understanding informed. Context alows us to register fields in a highly nested structure and allows us to do wild things such as scoping.
Below depicts the core to how this library works. Form controller is the master of all form elements and everyone else just subscribes to events that it triggers. The events can be caused by function calls from elsewhere. In the example below we depict what happens when a user types in an "H" in the name field
1<Form> 2 <Input name="name" /> {/* --> useField("name") --> useFieldState("name") */} 3 <Debug /> {/* --> useFormState() */} 4</Form>
+----------------+
| FormController | < ──────────────────────────────────────────
| state {} | │
+-------+--------+ │
│ │
│ event("field", "name") │
v │
+-------------------+ │
| Event System | ──────────────── │
+--------+----+-----+ │ │
│ │ │
│ event("field", "name") │ event("field", "name") │ setValue("H")
│ │ │
v v │
+-------------------+ +------------------------+ │
| useFormState() | | useFieldState("name") | │
+-------------------+ +------------------------+ │
^ ^ │
│ uses │ uses │
│ │ │
+-------------------+ +------------------------+ │
| <Debug /> | | useField("name") | ─────────
+-------------------+ +------------------------+
^
│ uses
│
+------------------------+
| <Input name="name" /> |
+------------------------+
I know, I know the types kinda suck. I personally don't use typescript so I have had to rely on other TS wizard devs to help maintain the types. When trying to type very complex objects such as FormState
especially parts like FormState.values
which can literally be an object that contains anything there are lots of opinions on how to properly type it. I'm actively seeking help here.
As stated earlier, docs now live in the vitedocs directory. Its called vitedocs
because I migrated them from storybook to now use a custom singe page react app built with vite
... pronounced "veet" by the way :)
Most of the docs contain examples where each example has a directory.
For example, if you look at the vitedocs/Pages/GettingStarted/CarColors
you will find the CarColors.jsx
file.
This file contains the page that gets shown ( whatever info you want to show on that page ) and then the example itself.
Because we use vite, we can take advantage of the fact that vite can import both a react component normally, and also the raw text from that file! Therefore creating examples is as simple as this!
Note how we make use of the SideBySide
component to render our code and example
1import Example from './Example'; 2import exampleCode from './Example.jsx?raw'; 3 4//... other stuff 5<SideBySide 6 leftHeader={<h3>Example: </h3>} 7 rightHeader={<h3>Code:</h3>} 8 left={<Example />} 9 right={<Code links input1={exampleCode} />} 10/>;
useConditional
hook.No vulnerabilities found.
No security vulnerabilities found.