{"id":14990162,"url":"https://github.com/daviddarnes/share-button","last_synced_at":"2025-04-12T02:05:27.830Z","repository":{"id":212165217,"uuid":"730258742","full_name":"daviddarnes/share-button","owner":"daviddarnes","description":"A Web Component to share web pages using the native OS sharing options","archived":false,"fork":false,"pushed_at":"2024-04-18T17:12:49.000Z","size":22,"stargazers_count":91,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-12T02:05:22.088Z","etag":null,"topics":["component","components","customelement","customelements","webcomponent","webcomponents"],"latest_commit_sha":null,"homepage":"https://daviddarnes.github.io/share-button/demo.html","language":"HTML","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/daviddarnes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"buy_me_a_coffee":"daviddarnes"}},"created_at":"2023-12-11T14:38:12.000Z","updated_at":"2025-03-22T23:24:58.000Z","dependencies_parsed_at":"2023-12-20T18:28:18.364Z","dependency_job_id":"81bdc761-3ce2-41c8-a7a6-604f8e62a678","html_url":"https://github.com/daviddarnes/share-button","commit_stats":null,"previous_names":["daviddarnes/share-button"],"tags_count":4,"template":false,"template_full_name":"daviddarnes/component-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviddarnes%2Fshare-button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviddarnes%2Fshare-button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviddarnes%2Fshare-button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daviddarnes%2Fshare-button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daviddarnes","download_url":"https://codeload.github.com/daviddarnes/share-button/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505863,"owners_count":21115354,"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":["component","components","customelement","customelements","webcomponent","webcomponents"],"created_at":"2024-09-24T14:19:38.468Z","updated_at":"2025-04-12T02:05:27.779Z","avatar_url":"https://github.com/daviddarnes.png","language":"HTML","readme":"# `share-button`\n\nA Web Component to share web pages using the native OS sharing options.\n\n**[Demo](https://daviddarnes.github.io/share-button/demo.html)** | **[Further reading](https://darn.es/share-button-web-component/)**\n\n## Examples\n\nGeneral usage example:\n\n```html\n\u003cscript type=\"module\" src=\"share-button.js\"\u003e\u003c/script\u003e\n\n\u003cshare-button\u003e\n  \u003cbutton\u003eShare\u003c/button\u003e\n\u003c/share-button\u003e\n```\n\nExample using a fallback links:\n\n```html\n\u003cscript type=\"module\" src=\"share-button.js\"\u003e\u003c/script\u003e\n\n\u003cshare-button\u003e\n  \u003cbutton\u003eShare\u003c/button\u003e\n  \u003ca\n    href=\"https://twitter.com/intent/tweet/?url=https://website.com\u0026amp;text=Example\u0026amp;via=DavidDarnes\"\n  \u003e\n    Post to Twitter\n  \u003c/a\u003e\n  \u003ca href=\"https://facebook.com/sharer/sharer.php?u=https://website.com\"\u003e\n    Post to Facebook\n  \u003c/a\u003e\n  \u003ca\n    href=\"https://www.linkedin.com/shareArticle?url=https://website.com\u0026amp;title=Example\u0026amp;source=Title\u0026amp;mini=true\"\n  \u003e\n    Post to LinkedIn\n  \u003c/a\u003e\n  \u003c!-- Find more sharing links here https://codepen.io/daviddarnes/pen/GRJgoxy --\u003e\n\u003c/share-button\u003e\n\u003cstyle\u003e\n  share-button:not(:defined) button,\n  share-button:defined a {\n    display: none;\n  }\n  share-button:not(:defined) a + a {\n    margin-inline-start: 1ch;\n  }\n\u003c/style\u003e\n```\n\nExample using a fallback `readonly` input:\n\n```html\n\u003cscript type=\"module\" src=\"share-button.js\"\u003e\u003c/script\u003e\n\n\u003cshare-button\u003e\n  \u003cbutton\u003eShare\u003c/button\u003e\n  \u003clabel\u003e\n    Share this page\n    \u003cinput\n      type=\"url\"\n      readonly\n      value=\"https://daviddarnes.github.io/share-button/demo.html\"\n      onclick=\"this.select()\"\n    /\u003e\n  \u003c/label\u003e\n\u003c/share-button\u003e\n\u003cstyle\u003e\n  share-button:not(:defined) button,\n  share-button:defined label {\n    display: none;\n  }\n\u003c/style\u003e\n```\n\n## Features\n\nThis Web Component allows you to:\n\n- Use a standard `button` element to show the native OS sharing options to share the current web page\n\n## Installation\n\nYou have a few options (choose one of these):\n\n1. Install via [npm](https://www.npmjs.com/package/@daviddarnes/share-button): `npm install @daviddarnes/share-button`\n1. [Download the source manually from GitHub](https://github.com/daviddarnes/share-button/releases) into your project.\n1. Skip this step and use the script directly via a 3rd party CDN (not recommended for production use)\n\n### Usage\n\nMake sure you include the `\u003cscript\u003e` in your project (choose one of these):\n\n```html\n\u003c!-- Host yourself --\u003e\n\u003cscript type=\"module\" src=\"share-button.js\"\u003e\u003c/script\u003e\n```\n\n```html\n\u003c!-- 3rd party CDN, not recommended for production use --\u003e\n\u003cscript\n  type=\"module\"\n  src=\"https://www.unpkg.com/@daviddarnes/share-button@1.1.3/share-button.js\"\n\u003e\u003c/script\u003e\n```\n\n```html\n\u003c!-- 3rd party CDN, not recommended for production use --\u003e\n\u003cscript\n  type=\"module\"\n  src=\"https://esm.sh/@daviddarnes/share-button@1.1.3\"\n\u003e\u003c/script\u003e\n```\n\n## Credit\n\nWith thanks to the following people:\n\n- [Zach Leatherman](https://zachleat.com) for inspiring this [Web Component repo template](https://github.com/daviddarnes/component-template)\n","funding_links":["https://buymeacoffee.com/daviddarnes"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaviddarnes%2Fshare-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaviddarnes%2Fshare-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaviddarnes%2Fshare-button/lists"}