react-form-page-transition

Form Page Transition in React

Usage no npm install needed!

<script type="module">
  import reactFormPageTransition from 'https://cdn.skypack.dev/react-form-page-transition';
</script>

README

react-form-page-transition

react-form-page-transition is a React component that enables to make easy <form /> page transitions

license npm latest package npm downloads

Installation

If you're using npm, in the command prompt run:

npm install react-form-page-transition --save

If you're using yarn, run:

yarn add react-form-page-transition

Usage

To use the component, first import FormPageTransition into your file:

import FormPageTransition from "react-form-page-transition";

Then, place the <FormPageTransition> in the component you want to make the page transition with forms.

A sample file might look like this:

import React from "react";
import FormPageTransition from "react-form-page-transition";

const App = () => (
  <FormPageTransition
    redirectUrl="redirectUrl"
    requestMethod="GET"
    requestBody={{ hello: "hola", world: "mundo" }}
  />
);

export default App;

Props

Name Type Default Description
redirectUrl string "" The action attribute value of the form
requestMethod "GET" | "POST" "GET" The method attribute value of the form
requestBody object {} The values of the form