Skip to content

portabletext/react-native-portabletext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e5e76f6 Â· Sep 10, 2024
Sep 10, 2024
Mar 16, 2024
Mar 16, 2024
Jan 14, 2022
Jan 14, 2022
Aug 24, 2023
Jan 14, 2022
Aug 24, 2023
Sep 10, 2024
Apr 18, 2023
Jun 21, 2022
Sep 10, 2024
Sep 10, 2024
Aug 24, 2023
Aug 24, 2023
Mar 16, 2024

Repository files navigation

@portabletext/react-native

Note: Experimental! Please report issues and feedback.

Render Portable Text with React Native.

Utilizes @portabletext/react under the hood, and thus has the exact same API, but will render 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