formik README

The project's README from github.com/jaredpalmer/formik. As one markdown file: README.md.

./packages/formik/README.md

formik (jaredpalmer/formik)

Searching Database…

34.3K ·GitHub
What is this?Formik is a small React library for building forms: it handles the three most annoying parts - getting values in and out of form state, validation and error messages, and handling form submission.
Is this a library I add to my React app, or a standalone tool?A library: Formik is an npm package written in TypeScript that you import into a React project and use to build forms with components, hooks, render props, or higher-order components.
How do I add it to a project?Install it with a package manager ('npm install formik' or 'yarn add formik') in your React project, then import it in your components like any other library.
Do I need to install anything else alongside it?No. Formik itself has zero runtime dependencies - the only prerequisite is an existing React project, since it is a form layer on top of React.
Will it work in a React Native app, or only on the web?Both. React Native is one of the project's official topics, and the same value, validation, and submission APIs work for native mobile forms as for the web.
What does a form actually look like in code?You wrap your markup in a component, passing it initialValues and an onSubmit callback; the package also exposes a hook (useFormik) and a withFormik HOC as alternatives to the render-prop style.
Is Formik still maintained, or is it abandoned?The repo is not archived and still shows an active workflow: CI runs on changes, releases are automated via changesets, and it has gathered around 34.3k stars since 2017.
Does it play well with TypeScript?Yes - Formik is written in TypeScript itself, so type definitions ship with the npm package and you get typed forms and handlers without extra installs.
Will it force a particular look on my forms?No. Formik manages state, validation, and submission only and ships no UI of its own - your markup and styles stay yours, and its helpers just wire values and handlers into your inputs.
Size
16.8 MB
Stars
34.3K
Age
9y
Commits · 90 Days