BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/pdfx/page-number

PageNumber

pdfx/page-number
FreeComponent

Dynamic page numbers with customizable format and alignment

See it running

Open the demo on pdfx

pdfx.akashpise.dev/docs/components/page-number
Open
This registry sends X-Frame-Options, so its page cannot be embedded here. The link is the same page the frame would have shown.

Install it

npx shadcn@latest add https://pdfx.akashpise.dev/r/page-number.json

Source

components/pdfx/page-number/pdfx-page-number.tsxpdfx.akashpise.dev/r/page-number.json
1import { Text as PDFText, StyleSheet, View } from '@react-pdf/renderer';
2import type { Style } from '@react-pdf/types';
3import { usePdfxTheme, useSafeMemo } from '../lib/pdfx-theme-context';
4type PdfxTheme = ReturnType<typeof usePdfxTheme>;
5
6export type PageNumberAlign = 'left' | 'center' | 'right';
7export type PageNumberSize = 'xs' | 'sm' | 'md';
8
9/**
10 * Auto page number rendered with a configurable format string at a fixed or inline position.
11 * Props - `format` | `align` | `size` | `fixed` | `muted` | `style`
12 * @see {@link PdfPageNumberProps}
13 */
14export interface PdfPageNumberProps {
15 /** Custom styles to merge with component defaults */
16 style?: Style;
17 /**
18 * Format string — use `{page}` for current page and `{total}` for total page count.
19 * @default 'Page {page} of {total}'
20 */
21 format?: string;
22 /**
23 * @default 'center'
24 */
25 align?: PageNumberAlign;
26 /**
27 * @default 'sm'
28 */
29 size?: PageNumberSize;
30 /**
31 * @default false
32 */
33 fixed?: boolean;
34 /**
35 * @default true
36 */
37 muted?: boolean;
38 children?: never;
39}
40
41function createPageNumberStyles(t: PdfxTheme) {
42 const { typography, colors, primitives } = t;
43 return StyleSheet.create({
44 container: { width: '100%' },
45 text: { fontFamily: typography.body.fontFamily },
46 alignLeft: { textAlign: 'left' },
47 alignCenter: { textAlign: 'center' },
48 alignRight: { textAlign: 'right' },
49 sizeXs: { fontSize: primitives.typography.xs },
50 sizeSm: { fontSize: primitives.typography.sm },
51 sizeMd: { fontSize: primitives.typography.base },
52 colorForeground: { color: colors.foreground },
53 colorMuted: { color: colors.mutedForeground },
54 });
55}
56
57function formatPageNumber(format: string, pageNumber: number, totalPages: number): string {
58 return format.replace('{page}', String(pageNumber)).replace('{total}', String(totalPages));
59}
60
61export function PdfPageNumber({
62 format = 'Page {page} of {total}',
63 align = 'center',
64 size = 'sm',
65 fixed = false,
66 muted = true,
67 style,
68}: PdfPageNumberProps) {
69 const theme = usePdfxTheme();
70 const styles = useSafeMemo(() => createPageNumberStyles(theme), [theme]);
71 const alignMap = {
72 left: styles.alignLeft,
73 center: styles.alignCenter,
74 right: styles.alignRight,
75 } as Record<PageNumberAlign, Style>;
76 const sizeMap = { xs: styles.sizeXs, sm: styles.sizeSm, md: styles.sizeMd } as Record<
77 PageNumberSize,
78 Style
79 >;
80 const textStyles: Style[] = [
81 styles.text,
82 alignMap[align],
83// … truncated

What it pulls in

npm packages

  • @react-pdf/renderer

Files it writes

  • components/page-number/page-number.tsx

Facts

Registry
pdfx
Type
registry:ui
Access
Free
Files written
1
Licence
NOASSERTION
In the index
at or before 2026-08-10
Last confirmed
yesterday

Go to the source

Docs on pdfx pdfx.akashpise.dev akii09/pdfx on GitHub Raw registry item This item as JSON

More from pdfx

All 34 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AlertalertpdfxComponentsFree1 dep
BadgebadgepdfxComponentsFree1 dep
CardcardpdfxComponentsFree1 dep
DataTabledata-tablepdfxComponentsFree1 dep · 3 files
DividerdividerpdfxComponentsFree1 dep
FormformpdfxComponentsFree1 dep · 3 files
GraphgraphpdfxComponentsFree1 dep · 4 files
HeadingheadingpdfxComponentsFree1 dep

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

KitGrade

SaaS starter kits, scored from measured facts

kitgrade.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex