Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 1.58 KB

README.md

File metadata and controls

58 lines (42 loc) · 1.58 KB

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: