@creatrix/safehtml
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

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>`}/>

Package Sidebar

Install

npm i @creatrix/safehtml

Weekly Downloads

3

Version

0.0.8

License

MIT

Unpacked Size

43.5 kB

Total Files

33

Last publish

Collaborators

  • creatrixlb