Skip to main content

MarkupText

Render Pango markup for inline formatting. Use Text for ordinary labels and paragraphs.

MarkupText in a native Kindle example

Usage​

Save this example as apps/Reader/App.js in the starter app.

import React from 'react';
import {MarkupText, View} from 'react-kindle';

export default function App() {
return (
<View style={{padding: 24}}>
<MarkupText markup={'<span font_desc="Amazon Ember 18px">Read <b>bold</b> and <i>italic</i> text.</span>'}
style={{width: '100%', height: 80}} />
</View>
);
}

Props​

PropType / defaultDescription
markupstringExplicit Pango markup; do not combine with children.
childrenstringPlain text, escaped before rendering.
sizepositive number = 18Font size for plain children.
styleView styleSupply enough height for the content.

Pass unformatted user text as children. Explicit markup is sent to the native parser as supplied.