labsUI
Accent color

Pager

Server-safe links to the previous and next page of a guide or docs site, each with the page's title. Works without JS; on the first or last page the missing side stays empty.

npx @kznlabs/labsui add pager
import { Pager } from "@/components/ui/pager";export function DocsPager() {  return (    <Pager      label="More guides"      previous={{ title: "Install", href: "/docs/install" }}      next={{ title: "Theming", href: "/docs/theming" }}    />  );}

<Pager>

Links to the previous and next page of a guide or docs site, titled so readers know where they lead. Layout follows its container.

  • labelDefault "Pages"
    string
    Accessible name of the navigation.
  • next
    PagerLink
    The page after this one. Left out on the last page.
  • nextLabelDefault "Next"
    ReactNode
    Word over the next page's title.
  • onNavigate
    (href: string, event: MouseEvent<HTMLAnchorElement, MouseEvent>) => void
    onClick for both links, e.g. for client routing or to stub links in a demo.
  • previous
    PagerLink
    The page before this one. Left out on the first page.
  • previousLabelDefault "Previous"
    ReactNode
    Word over the previous page's title.
PropTypeDefault
label
Accessible name of the navigation.
string"Pages"
next
The page after this one. Left out on the last page.
PagerLink—
nextLabel
Word over the next page's title.
ReactNode"Next"
onNavigate
onClick for both links, e.g. for client routing or to stub links in a demo.
(href: string, event: MouseEvent<HTMLAnchorElement, MouseEvent>) => void—
previous
The page before this one. Left out on the first page.
PagerLink—
previousLabel
Word over the previous page's title.
ReactNode"Previous"

Also accepts every <nav> prop.

type PagerLink
{ title: ReactNode; href: string; }

Every component also takes className.