CurrieTechnologies.Blazor.Clipboard 0.3.1

A Blazor component library for interacting with the browser clipboard.
Use in Client-side Blazor apps.

There is a newer version of this package available.
See the version list below for details.
Install-Package CurrieTechnologies.Blazor.Clipboard -Version 0.3.1
dotnet add package CurrieTechnologies.Blazor.Clipboard --version 0.3.1
<PackageReference Include="CurrieTechnologies.Blazor.Clipboard" Version="0.3.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CurrieTechnologies.Blazor.Clipboard --version 0.3.1
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

This package is for Client-side Blazor only. For Server-side Blazor use CurrieTechnologies.Razor.Clipboard

Usage

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

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

    public void ConfigureServices(IServiceCollection services)
    {
        ...
        services.AddClipboard();
        ...
    }
    
  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>
    
    @code
    {
        string textValue = string.Empty;
    }
    

CurrieTechnologies.Blazor.Clipboard

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

This package is for Client-side Blazor only. For Server-side Blazor use CurrieTechnologies.Razor.Clipboard

Usage

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

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

    public void ConfigureServices(IServiceCollection services)
    {
        ...
        services.AddClipboard();
        ...
    }
    
  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>
    
    @code
    {
        string textValue = string.Empty;
    }
    

Release Notes

Update Nuget description

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 236 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