Skip to content

HTML5 Clipboard API implementation for Microsoft Blazor

License

Notifications You must be signed in to change notification settings

Append-IT/Blazor.Clipboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clipboard

Implementation of the Clipboard API in C# for Microsoft Blazor.

Package Version NuGet Downloads License

Preview

Installation

Install-Package Append.Blazor.Clipboard

Demo

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

Usage

Add IClipboardService via DI

Scoped by default.

public void ConfigureServices(IServiceCollection services)
{
    services.AddClipboard();
}

Inject into component/pages

@using Append.Blazor.Clipboard
@inject IClipboardService ClipboardService

or

Inject on a BlazorComponent class:

[Inject] private IClipboardService _clipboardService { get; set; }

Copy Text

Using a Function (basic)

await ClipboardService.CopyTextToClipboardAsync("My text to Copy");

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 Clipboard API implementation for Microsoft Blazor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published