Skip to content

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

License

Notifications You must be signed in to change notification settings

Append-IT/Blazor.WebShare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published