@ui-registries/pdf

Link

Renders clickable hyperlinks in PDF documents.

Creates a tappable/clickable link in the PDF. Links can point to external URLs or internal anchors.

Demo

tsx
import { Document, Page, Block, Text, Link, Tailwind } from "@ui-registries/pdf";
<Tailwind>  <Document>    <Page size="A4" className="p-12 bg-white">      <Text className="text-base text-gray-700">        Visit our website at{" "}        <Link src="https://example.com" className="text-blue-600 underline">          example.com        </Link>{" "}        for more information.      </Text>    </Page>  </Document></Tailwind>
tsx
<Link  src="https://example.com/signup"  className="bg-blue-600 px-4 py-2 rounded-lg">  <Text className="text-white text-sm font-semibold text-center">    Sign Up Now  </Text></Link>
tsx
<Block className="flex flex-row gap-4 justify-center border-t border-gray-200 pt-4">  <Link src="https://example.com/terms" className="text-xs text-gray-500 underline">    Terms of Service  </Link>  <Link src="https://example.com/privacy" className="text-xs text-gray-500 underline">    Privacy Policy  </Link>  <Link src="https://example.com/contact" className="text-xs text-gray-500 underline">    Contact Us  </Link></Block>

Props

PropTypeDefault
children?React.ReactNode—
className?string—
style?Style—
break?boolean

Force the wrapping algorithm to start a new page when rendering the element.

—
debug?boolean

Enables debug mode on page bounding box.

—
fixed?boolean

Render component in all wrapped pages.

—
hitSlop?HitSlop

Extends the clickable area of the link beyond its visible bounds. Accepts a number (applied to all sides) or an object with top, bottom, left, right.

—
href?string—
id?string—
minPresenceAhead?number

Hint that no page wrapping should occur between all sibling elements following the element within n points

—
src?string—
wrap?boolean

Enable/disable page wrapping for element.

—