Everything *[NYC] 2026: see what we announced.

Portable Text to React Native

Serializes block content from the Portable Text standard to React PDF components with support for component customization and overrides.

By Cody Olsen & Espen Hovlandsdal

Install command

npm i @portabletext/react-native

@portabletext/react-native

Render Portable Text with React Native.

Uses @portabletext/react under the hood, and has the same API (except listNestingMode, which this package's PortableText does not accept), but renders React Native views instead of HTML.

Installation

npm install --save @portabletext/react-native

Basic usage

import {PortableText} from '@portabletext/react-native'

<PortableText
  value={[/* array of portable text blocks */]}
  components={/* optional object of custom components to use */}
/>

Styling the output

The rendered views has very little or no styling applied, so you will quite often want to pass custom components to override the built-in ones.

Customizing components

Customizing components are done in the same way as in @portabletext/react - see the README for more details.

License

MIT © Sanity.io

Related contributions