Gizmo.Web.JSInterop
1.0.0
See the version list below for details.
dotnet add package Gizmo.Web.JSInterop --version 1.0.0
NuGet\Install-Package Gizmo.Web.JSInterop -Version 1.0.0
<PackageReference Include="Gizmo.Web.JSInterop" Version="1.0.0" />
<PackageVersion Include="Gizmo.Web.JSInterop" Version="1.0.0" />
<PackageReference Include="Gizmo.Web.JSInterop" />
paket add Gizmo.Web.JSInterop --version 1.0.0
#r "nuget: Gizmo.Web.JSInterop, 1.0.0"
#:package Gizmo.Web.JSInterop@1.0.0
#addin nuget:?package=Gizmo.Web.JSInterop&version=1.0.0
#tool nuget:?package=Gizmo.Web.JSInterop&version=1.0.0
Gizmo.Web.JSInterop
Gizmo.Web.JSInterop
A JavaScript interop library for Blazor applications that provides seamless clipboard access functionality.
Features
- Read and write text to/from clipboard
- Read and write images to/from clipboard
- Check clipboard permissions
- Multi-item clipboard operations
Installation
Install the package from NuGet: A .NET library providing JavaScript interoperability functions for Blazor applications.
Features
Clipboard API
The library provides comprehensive clipboard functionality for Blazor applications:
- Check clipboard read/write permissions
- Read text from clipboard
- Write text to clipboard
- Read images from clipboard
- Write images to clipboard
- Write multiple formats (text and image) simultaneously
Usage
Installation
Add a reference to the Gizmo.Web.JSInterop package in your Blazor project:
dotnet add package Gizmo.Web.JSInterop
Register Services
In your Blazor application's Program.cs or Startup.cs:
builder.Services.AddScoped<Gizmo.Web.JSInterop.ClipboardApi>();
Import JavaScript
In your _Imports.razor or component:
@using Gizmo.Web.JSInterop
Use the Clipboard API
@inject ClipboardApi ClipboardApi
@code {
private async Task CopyTextToClipboard(string text)
{
if (await ClipboardApi.CanWrite())
{
await ClipboardApi.WriteText(text);
}
}
private async Task<string> GetTextFromClipboard()
{
if (await ClipboardApi.CanRead())
{
return await ClipboardApi.ReadText();
}
return string.Empty;
}
}
Requirements
- .NET 9.0
- Blazor WebAssembly or Blazor Server
Browser Compatibility
The Clipboard API relies on the browser's implementation of the Clipboard API. Functionality may vary depending on the browser and security context (HTTPS is generally required for clipboard operations).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Microsoft.AspNetCore.Components.Web (>= 9.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0-preview | 344 | 6/12/2025 |
| 1.0.2 | 87 | 2/24/2026 |
| 1.0.1 | 236 | 4/29/2025 |
| 1.0.0 | 393 | 4/24/2025 |