@addTagHelper *, TestContentPackage @using TestContentPackage

Functionality and content from an external package

NuGet packages can embed .NET code, which can in turn call Blazor's JS interop features if desired. This can be used to distribute new browser APIs as NuGet packages.

Click the following button to invoke a JavaScript function.

@if (!string.IsNullOrEmpty(result)) {

Result: @result

}

Additionally, NuGet packages can contain Blazor components, and even static resources such as CSS files and images.

@functions { string result; void ShowJavaScriptPrompt() { result = MyPrompt.Show("Hello!"); } }