Blazorify.JavaScript
1.0.0-alpha1
This is a prerelease version of Blazorify.JavaScript.
dotnet add package Blazorify.JavaScript --version 1.0.0-alpha1
NuGet\Install-Package Blazorify.JavaScript -Version 1.0.0-alpha1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Blazorify.JavaScript" Version="1.0.0-alpha1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blazorify.JavaScript --version 1.0.0-alpha1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Blazorify.JavaScript, 1.0.0-alpha1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Blazorify.JavaScript as a Cake Addin #addin nuget:?package=Blazorify.JavaScript&version=1.0.0-alpha1&prerelease // Install Blazorify.JavaScript as a Cake Tool #tool nuget:?package=Blazorify.JavaScript&version=1.0.0-alpha1&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Blazorify.JavaScript (Experiment)
A powerful C# library designed to seamlessly integrate JavaScript functionality into your Blazor applications. By providing a natural and intuitive C# interface, it eliminates the need for complex JavaScript interop techniques, making it easier than ever to leverage the vast ecosystem of JavaScript libraries and APIs directly from your C# code.
Installation
Install the library through the NuGet Package Manager or with following command:
dotnet add package Blazorify.JavaScript
Usage
// Get current location from JavaScript
var currentUrl = await this.JSRuntime.InvokeAsync<Window>(window => window.location.href);
// Get innerText value of an element passed as ElementReference
var innerText = await this.JSRuntime.InvokeAsync<HTMLElement>(this.elementRef, element => element.innerText);
// Get [data-value] attribute of an element passed as ElementReference
var dataValue = await this.JSRuntime.InvokeAsync<Element>(this.elementRef, element => element.getAttribute("data-value"));
// Adds "text-danger", "lead" and "mb-0" classes to an element passed as ElementReference
await this.JSRuntime.InvokeAsync<HTMLElement>(this.elementRef, element => element.classList.add("text-danger", "lead", "mb-0"));
Documentation
Prerequisites
Contributing
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Microsoft.AspNetCore.Components (>= 8.0.8)
- Microsoft.JSInterop (>= 8.0.8)
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 |
---|---|---|
1.0.0-alpha1 | 83 | 8/22/2024 |