A dynamic survey / form renderer for Blazor WebAssembly and Blazor Server. Feed it a Form model and it produces a validated, styled questionnaire with real-time value tracking and JSON output.
Play with the full demo
VisibleIf expression (evaluated via PSC.Evaluator at render time) that references other field valuesTerminateIf ends the survey when a condition becomes trueEditContexttxt_1, rdb_2, chk_3, …) or take your custom Name property1, 2, 3.1, 3.2 under panels); toggleable per surveyOnFormValuesChanged, OnFormSubmitted (with full JSON payload + typed values), OnFormSubmittedErrorForm / List<IElement> model from PSC.Survey.Shared (netstandard2.1, so it's consumable outside Blazor)FormExtensions.SerializeForm() / DeserializeForm() — same bytes accepted by every tool in the suite (Designer, CSV/Excel/JSON importers)CheckboxReturn, RadiobuttonReturn, MatrixReturn, SliderChoice, ImagePickerReturn, …)PSC.Blazor.Components.Survey) targeting .NET 10, tested with Blazor WebAssembly hosted and server-interactive modesPSC.Survey.Shared, netstandard2.1) as a transitive dependencySurveyBlazorUI demo — one page per element type with editable code snippets and live JSON previewLICENCE.md (one developer, annual commercial licence, unlimited end users, no redistribution)README.md with integration examples for every element type1. Install the package
dotnet add package PSC.Blazor.Components.Survey
2. Build a form in code (or deserialize one from JSON)
@using PSC.Survey.Shared
@using PSC.Survey.Shared.Interfaces
<Survey Form="_form" ShowDebug="true"
OnFormSubmitted="OnSubmitted" />
@code {
Form _form = new Form {
Elements = new List<IElement> {
new Textbox { Title = "Name", IsRequired = true },
new Radiobutton {
Title = "How did you hear about us?",
Choices = new List<object> { "Friend", "Search", "Ad" }
},
new Rating { Title = "Rate your experience" }
}
};
async Task OnSubmitted(FormSubmittedEventArgs e) {
var json = e.JsonValues; // post to your API
}
}
That's the whole integration. No DI registration, no scripts to add to index.html.
Form model (no more hand-writing JSON)