{"id":16589480,"url":"https://github.com/rnons/purescript-svg-parser-halogen","last_synced_at":"2026-02-19T13:03:13.597Z","repository":{"id":27770172,"uuid":"114522030","full_name":"rnons/purescript-svg-parser-halogen","owner":"rnons","description":"A library to inline SVG source string into halogen views","archived":false,"fork":false,"pushed_at":"2022-05-30T07:58:36.000Z","size":345,"stargazers_count":10,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-19T22:48:47.421Z","etag":null,"topics":["halogen","purescript","svg"],"latest_commit_sha":null,"homepage":"https://rnons.github.io/purescript-svg-parser-halogen","language":"PureScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rnons.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-12-17T08:45:43.000Z","updated_at":"2022-09-28T15:25:09.000Z","dependencies_parsed_at":"2022-09-11T07:01:10.447Z","dependency_job_id":null,"html_url":"https://github.com/rnons/purescript-svg-parser-halogen","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/rnons/purescript-svg-parser-halogen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnons%2Fpurescript-svg-parser-halogen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnons%2Fpurescript-svg-parser-halogen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnons%2Fpurescript-svg-parser-halogen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnons%2Fpurescript-svg-parser-halogen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rnons","download_url":"https://codeload.github.com/rnons/purescript-svg-parser-halogen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnons%2Fpurescript-svg-parser-halogen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29614593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T10:52:55.328Z","status":"ssl_error","status_checked_at":"2026-02-19T10:52:26.323Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["halogen","purescript","svg"],"created_at":"2024-10-11T23:08:58.789Z","updated_at":"2026-02-19T13:03:13.581Z","avatar_url":"https://github.com/rnons.png","language":"PureScript","readme":"# purescript-svg-parser-halogen\n\n\u003ca href=\"https://pursuit.purescript.org/packages/purescript-svg-parser-halogen\"\u003e\n  \u003cimg src=\"https://pursuit.purescript.org/packages/purescript-svg-parser-halogen/badge\"\n       alt=\"purescript-svg-parser-halogen on Pursuit\"\u003e\n  \u003c/img\u003e\n\u003c/a\u003e\n\nA library to inline SVG source string into halogen views.\n\nYou might be interested in [svgen](https://github.com/nonbili/svgen), a CLI tool to generate an icons module from svg files.\n\nSee [Demo](https://rnons.github.io/purescript-svg-parser-halogen) for an example.\n\n## How to use\n\n```purescript\nimport Svg.Renderer.Halogen (icon)\n\n-- | You can use FFI and webpack raw-loader to load external SVG files\ncode :: String\ncode = \"\"\"\u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"16\" viewBox=\"0 0 14 16\"\u003e\u003cpath fill-rule=\"evenodd\" d=\"M9.5 3L8 4.5 11.5 8 8 11.5 9.5 13 14 8 9.5 3zm-5 0L0 8l4.5 5L6 11.5 2.5 8 6 4.5 4.5 3z\"/\u003e\u003c/svg\u003e\"\"\"\n\ntype Icon = forall p r i. Array (IProp r i) -\u003e HTML p i\n\niconCode :: Icon\niconCode = icon code\n```\n\nIt's as simple as this, in most cases you only need the `icon` function. You can then use `iconCode` in your `render` function, you can also apply additional className to it.\n\n\n`Halogen.HTML.Properties.class_` won't work though, you need to use `Halogen.HTML.attr`.\n\n```purescript\nimport Halogen.HTML as HH\n\nclassName = HH.attr (HH.AttrName \"class\")\n\nrender state =\n  iconCode [ className \"icon\" ]\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frnons%2Fpurescript-svg-parser-halogen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frnons%2Fpurescript-svg-parser-halogen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frnons%2Fpurescript-svg-parser-halogen/lists"}