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
idDestination ID to be linked to. See moreStringundefined
bookmarkAttach bookmark to element. See moreString or Bookmarkundefined

On this page