How to handle links for transitions
mainYou can choose between two modes for triggering transitions:
1. Manual Mode (Default: auto={false})
You must use the custom Link component provided by next-transition-router instead of the standard Next.js Link. This is the most explicit way to ensure transitions trigger.
2. Auto Mode (auto={true})
When auto is enabled, the router automatically intercepts click events on internal links (excluding anchor links). In this mode, you can continue using standard Next.js Link components.
To prevent a specific link from triggering a transition in auto mode, add the data-transition-ignore attribute to the link element.
// Manual Mode
import { Link } from "next-transition-router";
export function Example() {
return <Link href="/about">About</Link>;
}
// Auto Mode (in TransitionRouter props)
<TransitionRouter auto={true}>
{/* Standard Next.js links will now trigger transitions */}
<Link href="/about">About</Link>
{/* This link will be ignored */}
<a href="/ignore-me" data-transition-ignore>Ignore</a>
</TransitionRouter>