• Stars
    star
    949
  • Rank 46,403 (Top 1.0 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 1 month ago
  • Updated 8 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Use CSS View Transitions API in Next.js App Router.

next-view-transitions

Use View Transitions API in Next.js App Router.

Demo.

Disclaimer

This library is aimed at basic use cases of View Transitions and Next.js App Router. With more complex applications and use cases like concurrent rendering, Suspense and streaming, new primitives and APIs still need to be developed into the core of React and Next.js in the future (more).

Installation

Use your favorite package manager to install the next-view-transitions package. For example:

pnpm install next-view-transitions

Usage

Wrap your content with the <ViewTransitions> component inside the layout file:

import { ViewTransitions } from 'next-view-transitions'

export default function Layout({ children }) {
  return (
    <ViewTransitions>
      <html lang='en'>
        <body>
          {children}
        </body>
      </html>
    </ViewTransitions>
  )
}

Then, use the <Link> component for links that need to trigger a view transition:

import { Link } from 'next-view-transitions'

export default function Component() {
  return (
    <div>
      <Link href='/about'>Go to /about</Link>
    </div>
  )
}

That's it!

License

MIT.

More Repositories

1

nextra

Simple, powerful and flexible site generation framework with everything you love from Next.js.
TypeScript
10,524
star
2

react-wrap-balancer

Simple React Component That Makes Titles More Readable
HTML
3,828
star
3

cobe

5kB WebGL globe lib.
MDX
2,977
star
4

tilg

A magical React Hook that helps you debug components.
TypeScript
2,100
star
5

nextra-docs-template

Nextra docs template
MDX
856
star
6

y86

A Y86 pipeline CPU simulator in JavaScript.
JavaScript
524
star
7

apple-pencil-safari-api-test

Canvas based sketch board, with force touch and real-time Bezier curves.
JavaScript
423
star
8

stable-hash

Stable JS value hash
TypeScript
228
star
9

yoga-wasm-web

WASM build of Yoga, targeting the web worker runtime.
TypeScript
177
star
10

cssosx

A CSS & JS made macOS UI.
CSS
135
star
11

next-cms

JavaScript
99
star
12

satori-syntax-highlighter

JavaScript
76
star
13

cc

Shu's Creative Coding template.
JavaScript
72
star
14

berlin-apartments

Information of apartments in Berlin for digital nomads.
72
star
15

site

JavaScript
67
star
16

charch

中文网页排版工具
JavaScript
53
star
17

photos

JavaScript
43
star
18

100-days-ui

Turn @npaulflavius's 100 Days UI design into React components!
JavaScript
39
star
19

ding

(deprecated) A douban FM client in OS X (web application).
JavaScript
35
star
20

css-computer

Computational Style Sheets
HTML
35
star
21

blog-template

JavaScript
30
star
22

flappybird

Flappy Bird in JS.
JavaScript
29
star
23

vrs

WebGL + React + VR experiment. Demo:
JavaScript
28
star
24

coverflow

Apple’s Coverflow UI effect.
HTML
26
star
25

nextra-theme-docs

A documentation site theme for Nextra.
JavaScript
21
star
26

satori

Highly experimental, do not use in prod.
JavaScript
20
star
27

random-branch

A Raycast plugin to generate random git branch names.
TypeScript
16
star
28

coursejs

Create online simple & nice courses, just in 3 minutes.
JavaScript
15
star
29

request-cancellation-test

Test the browser request cancellation behavior.
JavaScript
14
star
30

scheme

A TOY Scheme interpreter implemented with JavaScript.
JavaScript
14
star
31

labs

labs
JavaScript
13
star
32

nextra-theme-blog

A blog site theme for Nextra.
JavaScript
13
star
33

animator

Canvas animations & gifs made easy.
JavaScript
13
star
34

blog

Next.js + MDX + ▲ ZEIT Now
JavaScript
9
star
35

next-ts-plugin-vscode

Always-on Next.js TypeScript Plugin in VSCode
TypeScript
9
star
36

innsbruck-old

A static blogging tool (to be reconstructed).
JavaScript
8
star
37

nextra-example

JavaScript
7
star
38

react-less-boilerplate

git clone [email protected]:quietshu/react-less-boilerplate.git
JavaScript
6
star
39

cube

Renderer written with JavaScript ES6 (Computer Graphics from the ground up)
JavaScript
6
star
40

list-label

The list with fixed labels.
JavaScript
6
star
41

raytracing

Ray Tracing Algorithm (光线追踪算法的实现和思考).
TeX
6
star
42

ghc

Lazy GitHub clone: navigate files in CLI without downloading the whole repo.
JavaScript
6
star
43

ABS-frontend

Another Bookstore System (-frontend), part of my homework of Database System Concepts course in Fudan CS. 这是个典型的 AngularJS+Bootstrap app.
JavaScript
6
star
44

siff17

2017 上海国际电影节完整排片数据
JavaScript
5
star
45

neon

用手机简易遥控浏览器(仿 Kinect 的体感操作……(据说很不稳定))
5
star
46

og-example

JavaScript
5
star
47

delay

alert(1); yield 1000; alert(2); // It works like MAGIC!
5
star
48

mak-old

(old repository) 坐等... ->
JavaScript
5
star
49

socket-chat-room

TCP socket programming...only homework, overwhelmed by homework.
JavaScript
5
star
50

wishbottle

Mobile friendly version of stu.fudan.edu.cn/wish
JavaScript
4
star
51

pingdash

A simple dashboard.
JavaScript
4
star
52

leetcode-sol

弱。。。
JavaScript
4
star
53

13cs

13CS 院衫设计
CSS
4
star
54

-2048

Reverse 2048 with AI.
JavaScript
4
star
55

algorithm-contests

OI / ACM 代码记录
C++
4
star
56

loading

Another CSS3 loading animation tool for full-page & blocks.
CSS
4
star
57

shuffle-char

React char shuffling animation.
JavaScript
4
star
58

textbook

🚧
JavaScript
3
star
59

awesome-frontend-charts

A curated list of awesome front-end visualization libraries (charts, maps, etc.), updating.
3
star
60

faster

(Unique Hack Day)
JavaScript
3
star
61

test-worker-transform-stream

JavaScript
3
star
62

wpjax

A PushState plugin for WordPress.
PHP
2
star
63

angel

🚧 constructing
JavaScript
2
star
64

.vim

My vim files.
C++
2
star
65

simple-hard-captcha

Simple but hard captcha for Node.js.
JavaScript
2
star
66

empty

i am empty
HTML
1
star
67

js-crawler-demo

A sample webpage crawler using node.js: asynchronous + jQuery
JavaScript
1
star
68

minutiae

[WIP] CSS-in-JS replacement for inline styles
TypeScript
1
star
69

innsbruck-plugins

JavaScript
1
star
70

class-sheet

A package that generates image from class-sheet data.
JavaScript
1
star
71

baidu-tieba-watcher

[Deprecated] 百度贴吧潜水员
Objective-C
1
star
72

excited-frontend

Frontend files for "EXCITED!"
CSS
1
star
73

fdu-hci-2016

Some experiments in human-computer interaction
HTML
1
star
74

mov

Some NLP stuff
JavaScript
1
star
75

dogesite

WOW, such doge!
JavaScript
1
star