{"id":18333794,"url":"https://github.com/jeduan/react-native-htmltext2","last_synced_at":"2026-05-02T06:36:15.287Z","repository":{"id":66606551,"uuid":"55021470","full_name":"jeduan/react-native-htmltext2","owner":"jeduan","description":null,"archived":false,"fork":false,"pushed_at":"2016-04-04T21:43:20.000Z","size":86,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T19:53:50.730Z","etag":null,"topics":["react-native"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeduan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-30T01:05:11.000Z","updated_at":"2023-03-08T05:03:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"1debae66-6a93-48b6-9809-52d8b076c1ae","html_url":"https://github.com/jeduan/react-native-htmltext2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeduan%2Freact-native-htmltext2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeduan%2Freact-native-htmltext2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeduan%2Freact-native-htmltext2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeduan%2Freact-native-htmltext2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeduan","download_url":"https://codeload.github.com/jeduan/react-native-htmltext2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248091842,"owners_count":21046367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react-native"],"created_at":"2024-11-05T19:44:42.780Z","updated_at":"2026-05-02T06:36:13.648Z","avatar_url":"https://github.com/jeduan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-htmltext\n\nWIP: Experiment to use HTML like markup to create stylized text in react-native.\n\n## Why?\n\nReact Native provide a Text element for stylized text. Instead of using ``NSAttributedString``, \nyou creat nested Text:\n\n```\n\u003cText style={{fontWeight: 'bold'}}\u003e\n  I am bold \n  \u003cText style={{color: 'red'}}\u003e and red \u003c/Text\u003e\n\u003c/Text\u003e\n```\n\nWhile this approach is excellent for static interface text, what if we have dynamic text with format we \ndo not know until we use it? ``HtmlText`` is a component to present a limited subset of HTML as\nReact Native views.\n\n**Important**: This is not going to replace your ``WebView`` for HTML rendering, instead it use a\nlimited subset of HTML and try to present it using native ``Text`` elements in a reasonable way.\n\n## Example \n\n### Input\n\n```javascript\nrender: function() {\n  var html = `\u003cp\u003eHello world \u003cb\u003eworld\u003c/b\u003e \u003ci\u003efoo\u003c/i\u003e bar hahh\u003c/p\u003e`\n  return (\n    \u003cView style={styles.container}\u003e\n      \u003cHtmlText style={styles.welcome} html={html}\u003e\u003c/HtmlText\u003e\n    \u003c/View\u003e\n  );\n}\n```\n\u003cimg src=\"https://raw.githubusercontent.com/siuying/react-native-htmltext/master/example1.png\" /\u003e\n\n### Input \n\n```javascript\nrender: function() {\n  var html = `\u003cblockquote\u003e\u003cp\u003eHello world \u003cb\u003eworld\u003c/b\u003e \u003ci\u003efoo\u003c/i\u003e \u003cblockquote\u003ebar hahh\u003c/blockquote\u003e\u003c/p\u003e\u003c/blockquote\u003e`\n  return (\n    \u003cView style={styles.container}\u003e\n      \u003cHtmlText style={styles.welcome} html={html}\u003e\u003c/HtmlText\u003e\n    \u003c/View\u003e\n  );\n}\n```\n\n\n\u003cimg src=\"https://raw.githubusercontent.com/siuying/react-native-htmltext/master/example2.png\" /\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeduan%2Freact-native-htmltext2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeduan%2Freact-native-htmltext2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeduan%2Freact-native-htmltext2/lists"}