SoftwareDriven.SurveyJs.Blazor
1.0.0
See the version list below for details.
dotnet add package SoftwareDriven.SurveyJs.Blazor --version 1.0.0
NuGet\Install-Package SoftwareDriven.SurveyJs.Blazor -Version 1.0.0
<PackageReference Include="SoftwareDriven.SurveyJs.Blazor" Version="1.0.0" />
<PackageVersion Include="SoftwareDriven.SurveyJs.Blazor" Version="1.0.0" />
<PackageReference Include="SoftwareDriven.SurveyJs.Blazor" />
paket add SoftwareDriven.SurveyJs.Blazor --version 1.0.0
#r "nuget: SoftwareDriven.SurveyJs.Blazor, 1.0.0"
#:package SoftwareDriven.SurveyJs.Blazor@1.0.0
#addin nuget:?package=SoftwareDriven.SurveyJs.Blazor&version=1.0.0
#tool nuget:?package=SoftwareDriven.SurveyJs.Blazor&version=1.0.0
SoftwareDriven.SurveyJs.Blazor
A Blazor WebAssembly wrapper for SurveyJS — render
JSON-defined forms and surveys as a Blazor component. The SurveyJS JavaScript
and its theme CSS are shipped inside the package as a single minified bundle;
no separate npm install or <link> is required in your app.
Targets .NET 10 (net10.0).
Installation
dotnet add package SoftwareDriven.SurveyJs.Blazor
No script tag is required — the component loads its bundled JavaScript on demand via a dynamic import.
Usage
Add the namespace (e.g. in _Imports.razor):
@using SoftwareDriven.SurveyJs.Blazor
Place the SurveyHost component and pass a survey definition. Json accepts a
POCO, a JsonElement, or a JSON string — it is serialized to the SurveyJS
survey JSON format. OnComplete is raised with the answers as a JSON string
when the user finishes the survey.
<SurveyHost Json="surveyJson" OnComplete="HandleComplete" />
@if (result is not null)
{
<pre>@result</pre>
}
@code {
private string? result;
private readonly object surveyJson = new
{
title = "Short survey",
elements = new object[]
{
new { type = "text", name = "firstName", title = "What is your name?", isRequired = true },
new
{
type = "radiogroup",
name = "mood",
title = "How are you today?",
choices = new[] { "Good", "Neutral", "Bad" }
}
}
};
private void HandleComplete(string resultJson) => result = resultJson;
}
For the full survey JSON schema (question types, pages, validation, logic, theming) see the SurveyJS documentation.
Component reference
SurveyHost
| Parameter | Type | Description |
|---|---|---|
Json |
object (required) |
Survey definition in SurveyJS JSON format (POCO, JsonElement, or string). |
OnComplete |
EventCallback<string> |
Raised on completion with the survey answers serialized as a JSON string. |
The component renders into its own container element and disposes the underlying SurveyJS instance when removed from the render tree.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Microsoft.AspNetCore.Components.Web (>= 10.0.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.