https://github.com/jaredpalmer/formover
Build forms that pop bottles 🍾with Formik and React Popper
https://github.com/jaredpalmer/formover
formik popper popperjs react
Last synced: 6 months ago
JSON representation
Build forms that pop bottles 🍾with Formik and React Popper
- Host: GitHub
- URL: https://github.com/jaredpalmer/formover
- Owner: jaredpalmer
- Created: 2018-04-25T23:47:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-09T23:24:16.000Z (over 7 years ago)
- Last Synced: 2025-03-27T23:41:52.083Z (6 months ago)
- Topics: formik, popper, popperjs, react
- Language: TypeScript
- Homepage:
- Size: 183 KB
- Stars: 160
- Watchers: 3
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Formover
Formik x React Popper
## Why?
Quickly build forms that live in popovers like Airbnb's search filters.

## How
```
yarn add formik formover react-popper
``````tsx
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { FormikActions, Form, Field } from 'formik';
import { FormoverProps, PopoverProps, Formover } from 'formover';const Button: React.SFC = ({ innerRef, ...props }) => (
);export interface FormValues {
email: string;
}const App = () => (
Formik + React-Popper = Formover
, // formik bag
popperActions: PopoverProps // close, toggle, isOpen
) => {
setTimeout(() => {
alert(JSON.stringify(values, null, 2));
formikActions.setSubmitting(false);
popperActions.close();
}, 500);
}}
initialValues={{ email: '' }}
target={({ getTargetProps }) => (
Hello
)}
>
{(props: FormoverProps) => (
Cancel
Apply
)}
);
```
---MIT License