JSPM

@creatrix/safehtml

0.0.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q22775F
  • License MIT

renders your HTML into 100% native views

Package Exports

  • @creatrix/safehtml
  • @creatrix/safehtml/dist/cjs/index.js
  • @creatrix/safehtml/dist/esm/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@creatrix/safehtml) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

safehtml

HTML markup is translated into React Native views using react-native-elements with below setup:

color using theme.colors.textcolor //#000
font using theme.fonts.regular //fontFamily:'roboto'
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>`}/>