{"id":13638760,"url":"https://github.com/zachleat/webcare-webshare","last_synced_at":"2025-05-05T23:25:44.282Z","repository":{"id":222741463,"uuid":"758252313","full_name":"zachleat/webcare-webshare","owner":"zachleat","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-20T21:56:42.000Z","size":14,"stargazers_count":24,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T15:42:23.491Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://zachleat.github.io/webcare-webshare/demo.html","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/zachleat.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":"2024-02-15T23:19:53.000Z","updated_at":"2024-11-26T12:02:30.000Z","dependencies_parsed_at":"2024-06-09T14:02:01.532Z","dependency_job_id":"d70850aa-8c7e-469e-985b-166ecaea0f00","html_url":"https://github.com/zachleat/webcare-webshare","commit_stats":null,"previous_names":["zachleat/webcare-webshare"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachleat%2Fwebcare-webshare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachleat%2Fwebcare-webshare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachleat%2Fwebcare-webshare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachleat%2Fwebcare-webshare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zachleat","download_url":"https://codeload.github.com/zachleat/webcare-webshare/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252591805,"owners_count":21773160,"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":[],"created_at":"2024-08-02T01:00:53.018Z","updated_at":"2025-05-05T23:25:44.261Z","avatar_url":"https://github.com/zachleat.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# `\u003cwebcare-webshare\u003e` Web Component\n\nA web component that uses the [Web Share API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Share_API) to share a web site, falling back (on Desktop usually) to Copy to Clipboard.\n\n* [Demo](https://zachleat.github.io/webcare-webshare/demo.html)\n\t* In use on the registration flow for [`conf.11ty.dev`](https://conf.11ty.dev/).\n* [Blog post](https://www.zachleat.com/web/webcare-webshare/)\n*  Inspired by [_How to let the user share the website they are on_—Thomas Steiner (web.dev)](https://web.dev/patterns/web-apps/share/)\n\n\n\n## Features\n\n* Defaults to copy URL when Web Share API is not available.\n* Optionally override with your own copy-able content.\n* Custom button text when Web Share API is not available.\n\n## Installation\n\nYou can install via `npm` ([`@zachleat/webcare-webshare`](https://www.npmjs.com/package/@zachleat/webcare-webshare)) or download the `webcare-webshare.js` JavaScript file manually.\n\n```shell\nnpm install @zachleat/webcare-webshare --save\n```\n\nAdd `webcare-webshare.js` to your site’s JavaScript assets.\n\n## Usage\n\nUse `share-text` and `share-url` per the [Web Share API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Share_API). The button is un-disabled when initialized.\n\n```html\n\u003cwebcare-webshare share-text=\"I am going to the 11ty Conference! #11ty #11tyConf\" share-url=\"https://conf.11ty.dev/\"\u003e\n\t\u003cbutton disabled\u003eShare your ticket!\u003c/button\u003e\n\u003c/webcare-webshare\u003e\n```\n\n### Custom button text when Web Share API not available.\n\n_Copy to clipboard_ workflow only. Use the `label-copy` (Before) and `label-after-copy` (After) attributes.\n\n```html\n\u003cwebcare-webshare share-text=\"I am going to the 11ty Conference! #11ty #11tyConf\" share-url=\"https://conf.11ty.dev/\" label-copy=\"📋 Copy your ticket URL\" label-after-copy=\"✅ Copied to Clipboard\"\u003e\n\t\u003cbutton disabled\u003eShare your ticket!\u003c/button\u003e\n\u003c/webcare-webshare\u003e\n```\n\n### Set custom share content for copying.\n\n_Copy to clipboard_ workflow only. Use `copy-text` to override `share-url` as the default content that is copied when using Copy to Clipboard.\n\n```html\n\u003cwebcare-webshare share-text=\"I am going to the 11ty Conference! #11ty #11tyConf\" share-url=\"https://conf.11ty.dev/\" copy-text=\"Go to https://conf.11ty.dev/\"\u003e\n\t\u003cbutton disabled\u003eShare your ticket!\u003c/button\u003e\n\u003c/webcare-webshare\u003e\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzachleat%2Fwebcare-webshare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzachleat%2Fwebcare-webshare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzachleat%2Fwebcare-webshare/lists"}