Functions
useLinkStatus
Client hook imported from next/link. Read pending in a component rendered inside a Link, rather than a global navigation indicator. Fast or prefetched navigation may finish before an indicator becomes visible. Source: https://nextjs.org/docs/app/api-reference/functions/use-link-status. Documentation-reviewed illustrative draft; installed declarations and runtime not verified.
Formal Syntax & Structure
nextjs syntaxnextjs
import { useLinkStatus } from "next/link"Working Example
Example Snippetnextjs
'use client';import Link, {useLinkStatus} from 'next/link';function PendingLabel() { const {pending}=useLinkStatus(); return pending ? <span aria-hidden='true'> (opening)</span> : null;}export default function CatalogLink() { return <Link href='/catalog' prefetch={false}>Browse books<PendingLabel/></Link>;}