GitHub
ComponentsText

Text

A React component for displaying text. Text supports nesting of other Text or Link components to create inline styling.

import { Text } from '@react-pdf/renderer';

const Heading = () => (
  <Text style={{ fontSize: 18, marginBottom: 6 }}>
    Hello <Text style={{ color: 'tomato' }}>world</Text>
  </Text>
);
Show preview

Valid props

Prop nameDescriptionTypeDefault
wrapEnables/disables page wrapping for element. See moreBooleantrue
renderRenders dynamic content based on context. See moreFunctionundefined
styleDefines view styles. See moreObject, Arrayundefined
debugEnables debug mode on view bounding box. See moreBooleanfalse
fixedRenders component in all wrapped pages. See moreBooleanfalse
breakForces the wrapping algorithm to start a new page when rendering this element. See moreBooleanfalse
minPresenceAheadHint that no page wrapping should occur between all sibling elements following the element within n points. See moreNumber0
hyphenationCallbackSpecify hyphenation callback at a text level. See hypthenationFunctionundefined
hyphenationPenaltySpecify at what level words are hyphenated. See moreNumberundefined
idDestination ID to be linked to. See moreStringundefined
bookmarkAttach bookmark to element. See moreString or Bookmarkundefined

On this page