{"id":31551340,"url":"https://github.com/betomorrow/styled-tagged-text","last_synced_at":"2025-10-04T18:41:54.457Z","repository":{"id":89352102,"uuid":"392760184","full_name":"BeTomorrow/styled-tagged-text","owner":"BeTomorrow","description":"Parse your text and transform it into multiple React components with custom styles","archived":false,"fork":false,"pushed_at":"2023-02-27T17:00:15.000Z","size":1770,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-08T14:02:54.637Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BeTomorrow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-08-04T16:38:02.000Z","updated_at":"2024-03-10T11:25:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"4fe789a0-1b68-4bad-a480-757e93ba2602","html_url":"https://github.com/BeTomorrow/styled-tagged-text","commit_stats":{"total_commits":25,"total_committers":2,"mean_commits":12.5,"dds":"0.040000000000000036","last_synced_commit":"7b6b4cfcc9011b1fdcbbb7b33b99f346b5fb026c"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/BeTomorrow/styled-tagged-text","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeTomorrow%2Fstyled-tagged-text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeTomorrow%2Fstyled-tagged-text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeTomorrow%2Fstyled-tagged-text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeTomorrow%2Fstyled-tagged-text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BeTomorrow","download_url":"https://codeload.github.com/BeTomorrow/styled-tagged-text/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeTomorrow%2Fstyled-tagged-text/sbom","scorecard":{"id":20626,"data":{"date":"2025-08-11","repo":{"name":"github.com/BeTomorrow/styled-tagged-text","commit":"7b6b4cfcc9011b1fdcbbb7b33b99f346b5fb026c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/23 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: example/mobile/android/gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/BeTomorrow/styled-tagged-text/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/BeTomorrow/styled-tagged-text/main.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"33 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-cr5q-6q9f-rq6q","Warn: Project is vulnerable to: GHSA-j6gc-792m-qgm2","Warn: Project is vulnerable to: GHSA-pj73-v5mw-pm9j","Warn: Project is vulnerable to: GHSA-2rxp-v6pw-ch6m","Warn: Project is vulnerable to: GHSA-4xqq-m2hx-25v8","Warn: Project is vulnerable to: GHSA-5866-49gr-22v4","Warn: Project is vulnerable to: GHSA-r55c-59qm-vjw6","Warn: Project is vulnerable to: GHSA-vg3r-rm7w-2xgh","Warn: Project is vulnerable to: GHSA-vmwr-mc7x-5vc3","Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-rxrc-rgv4-jpvx","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-xq7p-g2vc-g82p","Warn: Project is vulnerable to: GHSA-7hpj-7hhx-2fgx","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-14T16:43:28.981Z","repository_id":89352102,"created_at":"2025-08-14T16:43:28.982Z","updated_at":"2025-08-14T16:43:28.982Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278358464,"owners_count":25973946,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-10-04T18:41:51.735Z","updated_at":"2025-10-04T18:41:54.412Z","avatar_url":"https://github.com/BeTomorrow.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Styled Tagged Text\n\nText component for React and React-Native application. Apply custom styles on specifics parts of your text, by enclosing them with bracket tags. Typically useful when using internationalization.\n\n## Features\n\n- **🧘 Easy to use**: Define a StyleSheet and the style will be applied to all text enclosed with tags, using keys as tag name.\n- **👩‍💻 Web and 📱 Mobile**: Use everywhere. You can use the same logic to apply rich text in your website and in your React-Native mobile app.\n- **🛠 TypeScript support**: styled-tagged-text is written entirely in TypeScript\n- **🐥 Lightweight**: Small library with no dependency resulting in a [5kb bundle](https://bundlephobia.com/package/betomorrow/styled-tagged-text)\n\n## Usage\n\n### Installation\n\n```bash\nnpm install @betomorrow/styled-tagged-text\n```\n\n### React-native component\n\n```tsx\n// style\nconst tagsStyle = StyleSheet.create({\n\tb: { fontWeight: \"700\" },\n\ti: { fontStyle: \"italic\" },\n\temph: { color: \"#eb4034\", fontSize: 16 },\n});\n\n// Component\nimport { StyledTaggedText } from \"@betomorrow/styled-tagged-text\";\n\n\u003cStyledTaggedText tagsStyle={tagsStyle}\u003e\n\tNormal [b]Bold[/b] [i][b]Bold Italic[/b] Italic[/i] [emph]Emphasize[/emph]\n\u003c/StyledTaggedText\u003e;\n```\n\nRender:\n\n![Render](https://github.com/BeTomorrow/styled-tagged-text/blob/main/asset/render.png?raw=true)\n\n\u003c!-- IMG --\u003e\n\nUse `\u003cStyledTaggedText\u003e` exactly like a `\u003cText\u003e` components.\n\n### Properties\n\n- `tagsStyle` : A record of style. Keys correspond to the tag name.\n- All `Text` (`span` on web) properties.\n\n### React component\n\n```tsx\n// Define your style\nconst tagsStyle = {\n\tb: { fontWeight: \"bold\" },\n\ti: { fontStyle: \"italic\" },\n\temph: { color: \"#eb4034\", fontSize: 16 },\n};\n\n// Component\nimport { StyledTaggedSpan } from \"@betomorrow/styled-tagged-text\";\n\n\u003cStyledTaggedSpan tagsStyle={tagsStyle}\u003e\n\tNormal [b]Bold[/b] [i][b]Bold Italic[/b] Italic[/i] [emph]Emphasize[/emph]\n\u003c/StyledTaggedSpan\u003e;\n```\n\nUse `\u003cStyledTaggedSpan\u003e` exactly like a `\u003cspan\u003e` components.\n\n## How it works ?\n\nUnderneath, `StyledTaggedText` (`StyledTaggedSpan` on web) are just nested `Text` (`span`) components with inline style. They have the exact same behavior, so you can transmit props as well.\n\n```TSX\n\u003cStyledTaggedSpan\n\ttagsStyle={{ b: { fontWeight: \"bold\" }, i: { fontStyle: \"italic\" }, emph: { color: \"#eb4034\", fontSize: 16 } }}\u003e\n\tNormal [b]Bold[/b] [i][b]Bold Italic[/b] Italic[/i] [emph]Emphasize[/emph]\n\u003c/StyledTaggedSpan\u003e\n```\n\nWill render exactly:\n\n```html\n\u003cspan\u003e\n\tNormal\n\t\u003cspan style=\"font-weight: bold;\"\u003eBold\u003c/span\u003e\n\t\u003cspan style=\"font-style: italic;\"\u003e\n\t\t\u003cspan style=\"font-weight: bold;\"\u003eBold Italic\u003c/span\u003e\n\t\tItalic\n\t\u003c/span\u003e\n\t\u003cspan style=\"color: rgb(235, 64, 52); font-size: 16px;\"\u003eEmphasize\u003c/span\u003e\n\u003c/span\u003e\n```\n\n## Example Playground\n\n[CodeBox Playground](https://codesandbox.io/s/styled-tagged-text-qb8gf?file=/src/App.tsx)\n\nReact-Native and Web demo are available in `example` folder\n\n## Tips\n\nDefine a global style and wrap our component to easily re-use the same stylesheet and tags.\n\n```TSX\nimport { StyledTaggedText } from \"@betomorrow/styled-tagged-text\";\nimport React from \"react\";\nimport { StyleSheet, TextProps } from \"react-native\";\n\ninterface StyledTextProps extends TextProps {\n\tchildren?: string;\n}\n\nexport const StyledText = (props: StyledTextProps) =\u003e {\n\tconst { children, ...otherProps } = props;\n\treturn (\n\t\t\u003cStyledTaggedText tagsStyle={tagsStyle} {...otherProps}\u003e\n\t\t\t{children}\n\t\t\u003c/StyledTaggedText\u003e\n\t);\n};\n\nconst tagsStyle = StyleSheet.create({\n\temph: {\n\t\tcolor: \"#1b66e4\",\n\t},\n});\n\n```\n\nAnd everywhere else in your app:\n\n```TSX\n\u003cStyledText\u003eSuper [emph]cool ![/emph]\u003c/StyledText\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetomorrow%2Fstyled-tagged-text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbetomorrow%2Fstyled-tagged-text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetomorrow%2Fstyled-tagged-text/lists"}