{"id":31135763,"url":"https://github.com/zeezide/svgwebview","last_synced_at":"2025-09-18T07:08:03.905Z","repository":{"id":63921270,"uuid":"365766610","full_name":"ZeeZide/SVGWebView","owner":"ZeeZide","description":"A SwiftUI View to display SVGs using WKWebView","archived":false,"fork":false,"pushed_at":"2022-11-17T10:33:11.000Z","size":15,"stargazers_count":15,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-16T06:35:43.547Z","etag":null,"topics":["svg","swift","swiftpackage","swiftui","swiftui-components"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/ZeeZide.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":"2021-05-09T14:02:04.000Z","updated_at":"2025-04-24T07:08:43.000Z","dependencies_parsed_at":"2023-01-14T14:15:19.789Z","dependency_job_id":null,"html_url":"https://github.com/ZeeZide/SVGWebView","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ZeeZide/SVGWebView","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeeZide%2FSVGWebView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeeZide%2FSVGWebView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeeZide%2FSVGWebView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeeZide%2FSVGWebView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZeeZide","download_url":"https://codeload.github.com/ZeeZide/SVGWebView/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeeZide%2FSVGWebView/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275725567,"owners_count":25516759,"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-09-18T02:00:09.552Z","response_time":77,"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":["svg","swift","swiftpackage","swiftui","swiftui-components"],"created_at":"2025-09-18T07:07:58.314Z","updated_at":"2025-09-18T07:08:03.891Z","avatar_url":"https://github.com/ZeeZide.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch2\u003e\n  SVGWebView\n  \u003cimg src=\"https://zeezide.de/img/svgshaper/SVGShaper512.png\"\n       align=\"right\" width=\"128\" height=\"128\" /\u003e\n\u003c/h2\u003e\n\n![SwiftUI](https://img.shields.io/badge/SwiftUI-orange.svg)\n![Swift5.3](https://img.shields.io/badge/swift-5.3-blue.svg)\n![macOS](https://img.shields.io/badge/os-macOS-green.svg?style=flat)\n![iOS](https://img.shields.io/badge/os-iOS-green.svg?style=flat)\n[![Build and Test](https://github.com/ZeeZide/SVGWebView/actions/workflows/swift.yml/badge.svg?branch=main)](https://github.com/ZeeZide/SVGWebView/actions/workflows/swift.yml)\n\nA [SwiftUI](https://developer.apple.com/xcode/swiftui/)\nView to display \n[SVGs](https://en.wikipedia.org/wiki/Scalable_Vector_Graphics) \n(Scalable Vector Graphics)\nusing a\n[WKWebView](https://developer.apple.com/documentation/webkit/wkwebview).\n\nExample usage in \n[SVG Shaper for SwiftUI](https://zeezide.de/en/products/svgshaper/)\n(it is the View displaying the SVG in the upper left):\n![SVG Shaper Screenshot](https://zeezide.de/img/svgshaper/screenshots/Lightmode/cook-xcode-2-light-framed-resized.png)\n\nNote: [SVG Shaper](https://zeezide.de/en/products/svgshaper/)\nis for converting SVGs to SwiftUI _source code_ (which then gets compiled).\n`SVGWebView` is for displaying SVG resources (e.g. loaded from a\nbundle or the web) at _runtime_. They serve different purposes.\n\n## Usage\n\nThis is just a single file, the \n[`SVGWebView.swift`](Sources/SVGWebView/SVGWebView.swift) \nis small enough for just copying it to your project.\nBut it can also be embedded as a SwiftPM package.\n\n*IMPORTANT*: \nOn macOS `WKWebView` requires the \"Outgoing Connections\" (client)\nentitlement to operate, w/o it'll show up blank. iOS doesn't seem to require\nanything extra.\n\nWith iOS Xcode Previews do not work quite right, best to test in a real \nsimulator.\n\n### Adding the Package\n\nThe package URL is: `https://github.com/ZeeZide/SVGWebView.git`\n\n### Using it in a SwiftUI App\n\nSimply pass the SVG string to the View. For example:\n\n```swift\nimport SwiftUI\nimport SVGWebView\n\nstruct ContentView: View {\n\n    var body: some View {\n        SVGWebView(svg:\n            \"\"\"\n            \u003csvg xmlns=\"http://www.w3.org/2000/svg\"\n                 viewBox=\"0 0 100 100\"\u003e\n              \u003crect x=\"10\" y=\"10\"\n                    width=\"80\" height=\"80\"\n                    fill=\"gold\" stroke=\"blue\"\n                    stroke-width=\"4\" /\u003e\n            \u003c/svg\u003e\n            \"\"\"\n        )\n        .frame(width: 300, height: 200)\n    }\n}\n\nstruct ContentView_Previews: PreviewProvider {\n\n    static var previews: some View {\n        ContentView()\n    }\n}\n```\n\n### Who\n\nSVGWebView is brought to you by [ZeeZide](https://zeezide.de).\nWe like feedback, GitHub stars, cool contract work, \npresumably any form of praise you can think of.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeezide%2Fsvgwebview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeezide%2Fsvgwebview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeezide%2Fsvgwebview/lists"}