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.
<PackageVersion Include="Blazorify.JavaScript" Version="1.0.0-alpha1" />
                    
Directory.Packages.props
<PackageReference Include="Blazorify.JavaScript" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Blazorify.JavaScript --version 1.0.0-alpha1
                    
#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.
#addin nuget:?package=Blazorify.JavaScript&version=1.0.0-alpha1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Blazorify.JavaScript&version=1.0.0-alpha1&prerelease
                    
Install as a Cake Tool

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 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.  net9.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 92 8/22/2024