@domchristie/next-turn

0.0.4 • Public • Published

next-turn

Animate Next.js page transitions with the View Transitions API.

Usage

npm i --save @domchristie/next-turn

Import and call useTurn in your component, for example in pages/_app.js:

import { useTurn } from '@domchristie/next-turn'

export default function App ({ Component, pageProps }) {
  useTurn()

  return (
    <>
      <nav>
        <Link href="/" >Home</Link>
        <Link href="/about" >About</Link>
      </nav>
      <main>
        <Component {...pageProps} />
      </main>
    </>
  )
}

Package Sidebar

Install

npm i @domchristie/next-turn

Weekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

3.28 kB

Total Files

3

Last publish

Collaborators

  • domchristie