# formik-error-scroll

> Scroll to the first error in your Formik form and set focus

Latest version **1.0.0** (published 2021-05-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install formik-error-scroll
pnpm add formik-error-scroll
yarn add formik-error-scroll
bun add formik-error-scroll
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-05-30 |
| First published | 2021-05-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | null-none |
| Keywords | formik, errors, scroll, scroll-to, focus |

## Links

- npm: https://www.npmjs.com/package/formik-error-scroll
- npm.io page: https://npm.io/package/formik-error-scroll

## Dependencies (1)

- [scroll-to-element](https://npm.io/package/scroll-to-element.md) ^2.0.3

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2021-05-30

## README

# formik-error-scroll

> Scroll to the first error in your Formik form and set focus

## Table of Contents

- [About](#about)
- [Usage](#usage)
- [Install](#install)

## About

Wrapper around [scroll-to-element](https://www.npmjs.com/package/scroll-to-element) that scrolls to the first error element in Formik.

## Usage

```js
import React from 'react'
import { Formik, Field, Form } from 'formik'
import FormikErrorScroll from 'formik-error-scroll'

export const Signup = () =>
  <div>
    <h1>My Uncool Persisted Form</h1>
    <Formik
      onSubmit={values => console.log(values)}
      initialValues={{ firstName: '', lastName: '', email: '' }}
      render={props =>
        <Form>
          <Field name="firstName" placeholder="First Name" />
          <Field name="lastName" placeholder="Last Name" />
          <Field name="email" type="email" placeholder="Email Address" />
          <button type="submit">Submit</button>
          <FormikErrorScroll
            offset={0}
            align={'top'}
            focusDelay={200}
            ease={'linear'}
            duration={1000}
          />
        </Form>}
    />
  </div>;
```


## Install

This project uses [node](https://nodejs.org) and [npm](https://www.npmjs.com).

```sh
$ npm install formik-error-scroll
$ # OR
$ yarn add formik-error-scroll
```

---
_Source: https://npm.io/package/formik-error-scroll · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
