GitHub
ComponentsView

View

The most fundamental component for building a UI and is designed to be nested inside other views and can have 0 to many children.

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

const Row = () => (
  <View style={{ flexDirection: 'row', gap: 10 }}>
    <View style={{ flex: 1, backgroundColor: '#eee', padding: 8 }}>
      <Text>Sidebar</Text>
    </View>
    <View style={{ flex: 2, padding: 8 }}>
      <Text>Content</Text>
    </View>
  </View>
);
Show preview

Valid props

Prop nameDescriptionTypeDefault
wrapEnable/disable page wrapping for element. See moreBooleantrue
styleDefines view styles. See moreObject, Arrayundefined
renderRender dynamic content based on context. See moreFunctionundefined
debugEnables debug mode on view bounding box. See moreBooleanfalse
fixedRender 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
idDestination ID to be linked to. See moreStringundefined
bookmarkAttach bookmark to element. See moreString or Bookmarkundefined

On this page