Skip to main content
Clever Ops

Prev Next Articles

End-of-article pagination, two hairline panels with mono direction labels and display titles, hairlines extending on hover. A lone neighbour panel spans the full width.

Preview & code

Loading Prev Next Articles preview

Installation

pnpm dlx shadcn@latest add @cleverui/prev-next-articles

Requires the @cleverui registry in your components.json, a one-off, two-line setup.

Usage

tsx
import { PrevNextArticles } from '@/components/blocks/prev-next-articles'
Exampletsx
import { PrevNextArticles } from '@/components/blocks/prev-next-articles'

export default function PrevNextArticlesDemo() {
  return (
    <div className="mx-auto w-full max-w-6xl px-4 py-12 sm:px-6">
      <PrevNextArticles
        previous={{
          title: 'Why we killed the status page carousel',
          href: '#status-carousel',
          category: 'Engineering',
        }}
        next={{
          title: 'Ship notes: the ledger view in Fieldkit 2.4',
          href: '#fieldkit-24',
          category: 'Release',
        }}
      />
    </div>
  )
}

API reference

PrevNextArticles accepts the following props.

PropTypeDefaultDescription
previousPrevNextArticleLinkthe earlier article; omit when none exists
nextPrevNextArticleLinkthe later article; omit when none exists
previousLabelstring'Previous'
nextLabelstring'Next'
labelstring'Article pagination'accessible name for the nav landmark

…plus everything from React.HTMLAttributes<HTMLElement>: className, event handlers, aria attributes and the rest pass straight through.

Referenced types

Typestsx
export interface PrevNextArticleLink {
  title: string
  href: string
  category?: string
}

Frequently asked questions

How do I install the Prev Next Articles component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/prev-next-articles`. The shadcn CLI copies the source into your project, you own the code from that point. You can also copy the source directly from this page.

What dependencies does Prev Next Articles require?

Prev Next Articles uses motion on top of React and Tailwind CSS. You don't need to install it manually, the shadcn CLI resolves and installs npm dependencies automatically when you add the component.

Can I theme Prev Next Articles to match my brand?

Yes. The component is styled entirely with Tailwind utilities over standard design tokens (primary, background, muted, border), so it inherits your existing shadcn/ui theme automatically. Change your CSS variables and the component follows, no source edits needed for palette, radius, or fonts.

Want this built for you?

CleverUI is built by the Clever Ops web team. If you'd rather ship a hand-coded, fast, custom website than assemble one, we build them for Australian businesses every week.

Explore web development services