Skip to content

Latest commit

 

History

History
67 lines (45 loc) · 2.07 KB

README.md

File metadata and controls

67 lines (45 loc) · 2.07 KB

Web Share

Implementation of the Web Share API in C# for Microsoft Blazor. The Web Share API allows a site to share text, links and other content to user-selected share targets, utilizing the sharing mechanisms of the underlying operating system.

Package Version NuGet Downloads License

Preview

recording.mov

Support

Data on support for the web-share feature across the major browsers from caniuse.com

Installation

Install-Package Append.Blazor.WebShare

Demo

There is a sample application in /docs folder which is also hosted as documentation.

Usage

Add IWebShareService via DI in Program.cs

Scoped by default.

builder.Services.AddWebShare();

Inject into component/pages

@using Append.Blazor.WebShare
@inject IWebShareService WebShareService

or

Inject on a BlazorComponent class:

[Inject] public IWebShareService WebShareService { get; set; } = default!;

Browser Support

bool IsSupported = await WebShareService.IsSupportedAsync()

Create a share

Using a Function (basic)

await WebShareService.ShareAsync("Title", "Text", "https://www.google.com");

Contributions and feedback

Please feel free to use the component, open issues, fix bugs or provide feedback.

Contributors

This project is created and maintained by: