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-header

PageHeader

pdfx/page-header
FreeComponent

Fixed or inline page header with 7 layout variants including logo support

See it running

Open the demo on pdfx

pdfx.akashpise.dev/docs/components/page-header
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-header.json

Source

components/pdfx/page-header/pdfx-page-header.tsxpdfx.akashpise.dev/r/page-header.json · first 6 KB
1import { Text as PDFText, StyleSheet, View } from '@react-pdf/renderer';
2import type { Style } from '@react-pdf/types';
3import type { ReactNode } from 'react';
4import { usePdfxTheme, useSafeMemo } from '../lib/pdfx-theme-context';
5type PdfxTheme = ReturnType<typeof usePdfxTheme>;
6
7export type PageHeaderVariant =
8 | 'simple'
9 | 'centered'
10 | 'minimal'
11 | 'branded'
12 | 'logo-left'
13 | 'logo-right'
14 | 'two-column';
15
16/**
17 * Header row with layout variants, logo support, and optional fixed positioning.
18 * Props - `title` | `subtitle` | `rightText` | `rightSubText` | `variant` | `background` | `titleColor` | `marginBottom` | `address` | `phone` | `email` | `logo` | `fixed` | `noWrap` | `style`
19 * @see {@link PageHeaderProps}
20 */
21export interface PageHeaderProps {
22 /** Custom styles to merge with component defaults */
23 style?: Style;
24 title: string;
25 subtitle?: string;
26 rightText?: string;
27 rightSubText?: string;
28 /**
29 * @default 'simple'
30 */
31 variant?: PageHeaderVariant;
32 background?: string;
33 titleColor?: string;
34 marginBottom?: number;
35 address?: string;
36 phone?: string;
37 email?: string;
38 logo?: ReactNode;
39 /**
40 * @default false
41 */
42 fixed?: boolean;
43 /**
44 * @default true
45 */
46 noWrap?: boolean;
47}
48
49const THEME_COLOR_KEYS = ['foreground','muted','mutedForeground','primary','primaryForeground','accent','destructive','success','warning','info'] as const;
50function resolveColor(value: string, colors: Record<string, string>): string {
51 return THEME_COLOR_KEYS.includes(value as (typeof THEME_COLOR_KEYS)[number]) ? colors[value] : value;
52}
53function createPageHeaderStyles(t: PdfxTheme) {
54 const { spacing, borderRadius, fontWeights } = t.primitives;
55 const c = t.colors;
56 const { heading, body } = t.typography;
57
58 return StyleSheet.create({
59 simpleContainer: {
60 display: 'flex',
61 flexDirection: 'row',
62 alignItems: 'flex-start',
63 justifyContent: 'space-between',
64 paddingBottom: spacing[4],
65 borderBottomWidth: spacing[0.5],
66 borderBottomColor: c.border,
67 borderBottomStyle: 'solid',
68 },
69 simpleLeft: {
70 display: 'flex',
71 flexDirection: 'column',
72 flex: 1,
73 },
74 simpleRight: {
75 display: 'flex',
76 flexDirection: 'column',
77 alignItems: 'flex-end',
78 },
79
80 centeredContainer: {
81 display: 'flex',
82 flexDirection: 'column',
83 alignItems: 'center',
84 paddingBottom: spacing[4],
85 borderBottomWidth: spacing[0.5],
86// … truncated

What it pulls in

npm packages

  • @react-pdf/renderer

Files it writes

  • components/page-header/page-header.tsx

Facts

Registry
pdfx
Type
registry:ui
Access
Free
Files written
1
Licence
NOASSERTION
First indexed
2026-08-02
Last confirmed
today

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
BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex

BlockDex

Built by

Kynth Studio

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

BlockDex