KeepTogether
pdfx/keep-togetherFreeComponent
Prevents page breaks within wrapped content
See it running
Open the demo on pdfx
pdfx.akashpise.dev/docs/components/keep-togetherInstall it
npx shadcn@latest add https://pdfx.akashpise.dev/r/keep-together.jsonSource
1import { View } from '@react-pdf/renderer';2import type { Style } from '@react-pdf/types';3import type { ReactNode } from 'react';45/**6 * Layout wrapper that prevents its children from splitting across PDF pages.7 * Props - `children` | `minPresenceAhead` | `style`8 * @see {@link KeepTogetherProps}9 */10export interface KeepTogetherProps {11 children?: ReactNode;12 minPresenceAhead?: number;13 style?: Style;14}1516export function KeepTogether({ children, minPresenceAhead, style }: KeepTogetherProps) {17 return (18 <View wrap={false} minPresenceAhead={minPresenceAhead} style={style}>19 {children}20 </View>21 );22}
What it pulls in
npm packages
Files it writes
More from pdfx
All 34 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Alertalert | pdfx | Components | Free | 1 dep | |
| Badgebadge | pdfx | Components | Free | 1 dep | |
| Cardcard | pdfx | Components | Free | 1 dep | |
| DataTabledata-table | pdfx | Components | Free | 1 dep · 3 files | |
| Dividerdivider | pdfx | Components | Free | 1 dep | |
| Formform | pdfx | Components | Free | 1 dep · 3 files | |
| Graphgraph | pdfx | Components | Free | 1 dep · 4 files | |
| Headingheading | pdfx | Components | Free | 1 dep |
