SoftwareDriven.SurveyJs.Blazor 1.0.0

There is a newer version of this package available.
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
                    
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="SoftwareDriven.SurveyJs.Blazor" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SoftwareDriven.SurveyJs.Blazor" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SoftwareDriven.SurveyJs.Blazor" />
                    
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 SoftwareDriven.SurveyJs.Blazor --version 1.0.0
                    
#r "nuget: SoftwareDriven.SurveyJs.Blazor, 1.0.0"
                    
#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.
#:package SoftwareDriven.SurveyJs.Blazor@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SoftwareDriven.SurveyJs.Blazor&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=SoftwareDriven.SurveyJs.Blazor&version=1.0.0
                    
Install as a Cake Tool

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 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. 
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
2.0.1 57 11/25/2026
2.0.0 165 9/3/2026
1.1.0 159 7/9/2026
1.0.0 140 7/8/2026