CurrieTechnologies.Blazor.Clipboard 0.2.0

A Blazor JSInterop library for interacting with the browser clipboard

There is a newer version of this package available.
See the version list below for details.
Install-Package CurrieTechnologies.Blazor.Clipboard -Version 0.2.0
dotnet add package CurrieTechnologies.Blazor.Clipboard --version 0.2.0
<PackageReference Include="CurrieTechnologies.Blazor.Clipboard" Version="0.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CurrieTechnologies.Blazor.Clipboard --version 0.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

CurrieTechnologies.Blazor.Clipboard

This package provides Blazor applications with access to the browser's Clipboard API

Usage

  1. In your Blazor app, add the CurrieTechnologies.Blazor.Clipboard NuGet package

    Install-Package CurrieTechnologies.Blazor.Clipboard -IncludePrerelease
    
  2. In your Blazor app's Startup.cs, register the 'ClipboardService'.

    public void ConfigureServices(IServiceCollection services)
    {
        ...
        services.AddSingleton<ClipboardService>();
        ...
    }
    
  3. Now you can inject the ClipboardService into any Blazor page and use it like this:

    @using CurrieTechnologies.Blazor.Clipboard
    @inject ClipboardService clipboard
    
    <input bind="@textValue" />
    <button onclick="@(async e => await clipboard.WriteTextAsync(textValue))">Copy To Clipboard</button>
    <button onclick="@(async e => textValue = await clipboard.ReadTextAsync())">Paste From Clipboard</button>
    
    @functions
    {
        string textValue = string.Empty;
    }
    

CurrieTechnologies.Blazor.Clipboard

This package provides Blazor applications with access to the browser's Clipboard API

Usage

  1. In your Blazor app, add the CurrieTechnologies.Blazor.Clipboard NuGet package

    Install-Package CurrieTechnologies.Blazor.Clipboard -IncludePrerelease
    
  2. In your Blazor app's Startup.cs, register the 'ClipboardService'.

    public void ConfigureServices(IServiceCollection services)
    {
        ...
        services.AddSingleton<ClipboardService>();
        ...
    }
    
  3. Now you can inject the ClipboardService into any Blazor page and use it like this:

    @using CurrieTechnologies.Blazor.Clipboard
    @inject ClipboardService clipboard
    
    <input bind="@textValue" />
    <button onclick="@(async e => await clipboard.WriteTextAsync(textValue))">Copy To Clipboard</button>
    <button onclick="@(async e => textValue = await clipboard.ReadTextAsync())">Paste From Clipboard</button>
    
    @functions
    {
        string textValue = string.Empty;
    }
    

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.4.0 237 7/24/2019
0.3.1 101 6/14/2019
0.3.0 113 6/12/2019
0.2.1 143 6/10/2019
0.2.0 157 6/4/2019
0.1.2 170 6/3/2019