---
site: ui.zyx.tw
url: https://ui.zyx.tw/page-decode-next
title: Page Decode for Next.js
description: "PageDecode on the Next.js App Router: it follows the router's path and leaves through router.push, so links stay client side."
---

# Page Decode for Next.js

PageDecode on the Next.js App Router: it follows the router's path and leaves through router.push, so links stay client side.

Group: Layout.

## Install

```bash
bunx shadcn@latest init https://ui.zyx.tw/r/base.json
bunx shadcn@latest add @zyx1121/page-decode-next
```

The first line sets a project up on the base; skip it if the project already has it.

## Item

### Page Decode for Next.js (`page-decode-next`)

PageDecode on the Next.js App Router: it follows the router's path and leaves through router.push, so links stay client side.

- Use when: Mounting the page motion once in a Next.js root layout.
- Not for: Vite or other React apps; mount page-decode there.
- Related: [page-decode](https://ui.zyx.tw/page-decode.md), [corners](https://ui.zyx.tw/corners.md)
- Categories: layout, motion, nextjs
- Install: `bunx shadcn@latest add https://ui.zyx.tw/r/page-decode-next.json`
- JSON: [page-decode-next.json](https://ui.zyx.tw/r/page-decode-next.json)
- Page: [https://ui.zyx.tw/page-decode-next](https://ui.zyx.tw/page-decode-next) ([Markdown](https://ui.zyx.tw/page-decode-next.md))
- npm dependencies: `next`
- Registry dependencies: `https://ui.zyx.tw/r/page-decode.json`

## More

- [Index](https://ui.zyx.tw/index.md): every item
- [Agent instructions](https://ui.zyx.tw/agent-instructions.md): the call order and the rules
- [DESIGN.md](https://github.com/zyx1121/www.zyx.tw/blob/main/apps/ui/DESIGN.md): the design contract
