@creatrix/safehtml
v0.0.8
Published
renders your HTML into 100% native views
Downloads
4
Maintainers
Readme
safehtml
HTML markup is translated into React Native views using react-native-elements with below setup:
color using theme.colors.textcolor
//ex: #000
font regular using theme.fonts.regular
//ex: fontFamily:'roboto'
font bold using theme.fonts.bold
//ex: fontFamily:'roboto bold'
size using theme.variables.fontSizeNormal
//13
example
yarn add @creatrix/safehtml
npm i @creatrix/safehtml
import SafeHtml from @creatrix/safehtml;
<SafeHtml text={`<p style="font-size: 1.2rem; padding: 0 10px;">
Lorem ipsum dolor sit amet, consectetur adipiscing
elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat.
</p>
<p style="color: purple; padding: 0 10px;">
Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore
eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia
deserunt mollit anim id est laborum.
</p>`}/>