{"id":13466401,"url":"https://github.com/jsakamoto/Toolbelt.Blazor.TwitterShareButton","last_synced_at":"2025-03-25T21:32:13.259Z","repository":{"id":66230935,"uuid":"161346842","full_name":"jsakamoto/Toolbelt.Blazor.TwitterShareButton","owner":"jsakamoto","description":"A Tweet Button component  for Blazor.","archived":false,"fork":false,"pushed_at":"2021-08-08T13:34:48.000Z","size":546,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T19:51:24.926Z","etag":null,"topics":["blazor","blazor-client","blazor-server","blazor-webassembly","twitter-button"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsakamoto.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}},"created_at":"2018-12-11T14:32:31.000Z","updated_at":"2023-08-05T15:40:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"f3b95f0d-3163-4b5b-9aab-d2d99b59ab3f","html_url":"https://github.com/jsakamoto/Toolbelt.Blazor.TwitterShareButton","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FToolbelt.Blazor.TwitterShareButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FToolbelt.Blazor.TwitterShareButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FToolbelt.Blazor.TwitterShareButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsakamoto%2FToolbelt.Blazor.TwitterShareButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsakamoto","download_url":"https://codeload.github.com/jsakamoto/Toolbelt.Blazor.TwitterShareButton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245548283,"owners_count":20633549,"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":["blazor","blazor-client","blazor-server","blazor-webassembly","twitter-button"],"created_at":"2024-07-31T15:00:43.579Z","updated_at":"2025-03-25T21:32:12.652Z","avatar_url":"https://github.com/jsakamoto.png","language":"C#","funding_links":[],"categories":["Libraries \u0026 Extensions"],"sub_categories":["Components"],"readme":"# Blazor Tweet Button [![NuGet Package](https://img.shields.io/nuget/v/Toolbelt.Blazor.TwitterShareButton.svg)](https://www.nuget.org/packages/Toolbelt.Blazor.TwitterShareButton/)\n\n## Summary\n\nA Tweet Button component for Blazor.\n\nThis component supports **both server-side Blazor Server App and client-side Blazor WebAssembly App**.\n\n\"Blazor Tweet Button\" ver.8.x supports Blazor versions below.\n\n- v.3.2 \n    - including preview 2~5 and release candidates.\n- v.5.0 \n    - including previews and release candidates.\n\n## How to install and use?\n\n### 1. Installation and Registration\n\n**Step.1-1** Install the library via NuGet package, like this.\n\n```shell\n\u003e dotnet add package Toolbelt.Blazor.TwitterShareButton\n```\n\n**Step.1-2** Open namespace, like this.\n\n```csharp\n// _Imports.razor\n...\n@using Toolbelt.Blazor.TwitterShareButton\n```\n\n### 2. Usage in your Blazor component (.razor)\n\nYou can use `TwitterShareButton` component.\n\nIf you implement your component like this,\n\n```html\n\u003cTwitterShareButton \n  Text=\"@($\"Current Count is {currentCount}\")\"\n  Size=\"Large\"\u003e\n\u003c/TwitterShareButton\u003e\n```\n\nThen you will get this.\n\n![fig.1](https://raw.githubusercontent.com/jsakamoto/Toolbelt.Blazor.TwitterShareButton/master/.assets/fig1.png)\n\n## Appendix - bundled support JavaScript\n\n`TwitterShareButton` component automatically inject a reference of the support JavaScript file which is bundled with this NuGet package into `\u003chead\u003e` element of the current document.\n\nThe support JavaScript file is deployed at the URL \"_content/Toolbelt.Blazor.TwitterShareButton/script.js\".\n\nIf you want to disable this behavior, you can configure it in one of the following ways:\n\n### a. \"DisableClientScriptAutoInjection\" property of the \"TwitterShareButton\" component\n\nYou can disable automatic injection of a reference of the support JavaScript file by \"DisableClientScriptAutoInjection\" property of the \"TwitterShareButton\" component.\n\nIf you set to `false` the \"DisableClientScriptAutoInjection\" property of the \"TwitterShareButton\" component, the \"TwitterShareButton\" doesn't inject a reference of the support JavaScript file.\n\n```html\n\u003cTwitterShareButton Text=\"...\"\n  DisableClientScriptAutoInjection=\"false\"\u003e\n\u003c/TwitterShareButton\u003e\n```\n\n### b. Configure global options for \"TwitterShareButton\" at \"Startup\" class\n\nYou can also disable automatic injection of a reference of the support JavaScript file by configure global options for \"TwitterShareButton\" at \"Startup\" class, like this.\n\n```csharp\n...\nusing Toolbelt.Blazor.Extensions.DependencyInjection; // \u003c- Add this...\n\npublic class Startup\n{\n  public void ConfigureServices(IServiceCollection services)\n  {\n    // ...and add flollow lines.\n    services.AddTwitterShareButtonGlobalOptions(options =\u003e\n    {\n       options.DisableClientScriptAutoInjection = false;\n    });\n   ...\n```\n\n### Note\n\n#### (a)\n\nDisabling \"automatic injection\" by configure global options way is more high priority than the \"DisableClientScriptAutoInjection\" property of the \"TwitterShareButton\" component.\n\nIf you configure global options \"DisableClientScriptAutoInjection\" to be true, then \"automatic injection\" never work even if set the \"DisableClientScriptAutoInjection\" property of the \"TwitterShareButton\" component to `false` explicity.\n\n#### (b)\n\nIf you disable \"automatic injection\", Adding a reference to the support JavaScript file is a responsibility of you.\n\nFor example, you can do it by editing \"index.html\" and add `\u003cscript\u003e` tag statically like following:\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n  ...\n  \u003cscript src=\"_content/Toolbelt.Blazor.TwitterShareButton/script.js\"\u003e\u003c/script\u003e\n```\n\n## Release Note\n\nThe release notes are [here.](https://github.com/jsakamoto/Toolbelt.Blazor.TwitterShareButton/blob/master/RELEASE-NOTES.txt)\n\n## License\n\n[Mozilla Public License Version 2.0](https://github.com/jsakamoto/Toolbelt.Blazor.TwitterShareButton/blob/master/LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsakamoto%2FToolbelt.Blazor.TwitterShareButton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsakamoto%2FToolbelt.Blazor.TwitterShareButton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsakamoto%2FToolbelt.Blazor.TwitterShareButton/lists"}