{"id":19533960,"url":"https://github.com/rafgraph/react-simplemark","last_synced_at":"2025-08-13T11:52:10.708Z","repository":{"id":57344804,"uuid":"92772116","full_name":"rafgraph/react-simplemark","owner":"rafgraph","description":"React component and renderer for Simplemark","archived":false,"fork":false,"pushed_at":"2020-10-02T04:39:27.000Z","size":75,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-12T01:04:58.784Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://simplemark.rafgraph.dev","language":"JavaScript","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/rafgraph.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}},"created_at":"2017-05-29T20:12:22.000Z","updated_at":"2023-03-09T01:40:39.000Z","dependencies_parsed_at":"2022-09-16T07:50:14.604Z","dependency_job_id":null,"html_url":"https://github.com/rafgraph/react-simplemark","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/rafgraph/react-simplemark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafgraph%2Freact-simplemark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafgraph%2Freact-simplemark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafgraph%2Freact-simplemark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafgraph%2Freact-simplemark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafgraph","download_url":"https://codeload.github.com/rafgraph/react-simplemark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafgraph%2Freact-simplemark/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270235528,"owners_count":24550185,"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-08-13T02:00:09.904Z","response_time":66,"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":"2024-11-11T02:11:30.636Z","updated_at":"2025-08-13T11:52:10.665Z","avatar_url":"https://github.com/rafgraph.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Simplemark\n\n[Demo website](https://simplemark.rafgraph.dev)\n\nReact component and renderer for [Simplemark](https://github.com/rafgraph/simplemark) (*never* uses `dangerouslySetInnerHTML`). Code styled with Prettier.\n\n```shell\n$ yarn add react-simplemark\n# OR\n$ npm install --save react-simplemark\n```\n\n```js\nimport React from 'react';\nimport Simplemark from 'react-simplemark';\n\nconst stringContainingSimplemarkSource = '# Simplemark Parser is Small ~1KB!!';\n\nclass App extends React.Component {\n  render() {\n    return (\n      \u003cSimplemark\u003e\n        {stringContainingSimplemarkSource}\n      \u003c/Simplemark\u003e\n    );\n  }\n}\n```\n\n```js\n// you can optionally provide `renderer` and `as` props to \u003cSimplemark\u003e\n// (as well as pass through props for the container)\n...\n\u003cSimplemark as=\"div\" renderer={customRenderer} className=\"simplemark-container\"\u003e\n  {stringContainingSimplemarkSource}\n\u003c/Simplemark\u003e\n```\n\n## API\n### `\u003cSimplemark\u003e`\n#### `children: string`\n- String containing the Simplemark source to render\n- Not required, but if not provided `\u003cSimplemark\u003e` returns `null` and does not render\n\n#### `as: string | ReactComponent`\n- Not required, default is `'div'`\n- What the simplemark container element is rendered as\n- String as an html tag name, e.g. `'div'` will render a `\u003cdiv\u003e` container, `'section'` will render a `\u003csection\u003e` container, etc...\n- If you provide a `ReactComponent` instead of a string, the rendered simplemark will be passed down as an array of `children` to that component\n\n#### `renderer: object`\n- Not required, but if it is not provided unstyled ReactElements will be created\n- Object with React Components for each type of element created by Simplemark\n- For a reference `renderer` with bare bones React Components see [`simplemarkReactRenderer.js`](https://github.com/rafgraph/react-simplemark/blob/main/src/simplemarkReactRenderer.js)\n```js\n// list of all element types created by Simplemark\n// if an element type is not present, the default renderer for that type is used\nconst renderer = {\n  Heading: /* ReactComponent */,\n  Paragraph: /* ReactComponent */,\n  Link: /* ReactComponent */,\n  Emph: /* ReactComponent */,\n  Strong: /* ReactComponent */,\n  InlineBreak: /* ReactComponent */,\n  BlockBreak: /* ReactComponent */,\n};\n```\n\n#### `...rest`\n- All other props will be passed down to the simplemark container element, e.g. `className`, `style`, etc...\n- For example `\u003cSimplemark as=\"section\" className=\"simplemark-container\"\u003e# Some Heading\u003c/Simplemark\u003e` will render on the page as `\u003csection class=\"simplemark-container\"\u003e\u003ch1\u003eSome Heading\u003c/h1\u003e\u003csection/\u003e`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafgraph%2Freact-simplemark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafgraph%2Freact-simplemark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafgraph%2Freact-simplemark/lists"}