Class RadzenFieldset
A fieldset container component that groups related form fields with a legend/header and optional collapse functionality. RadzenFieldset provides semantic form grouping with visual borders, useful for organizing complex forms into logical sections. Fieldsets are HTML form elements that semantically group related inputs, improving form structure and accessibility. Features visual and semantic grouping of related form fields, customizable header via Text or HeaderTemplate, optional expand/collapse to hide/show grouped fields, optional icon in the legend, optional summary content shown when collapsed, and screen reader announcement of fieldset legends for grouped fields. Use to organize forms into sections like "Personal Information", "Address", "Payment Details". When AllowCollapse is enabled, users can collapse sections they don't need to see.
Inherited Members
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
Syntax
public class RadzenFieldset : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Examples
Basic fieldset grouping form fields:
<RadzenFieldset Text="Personal Information">
<RadzenStack Gap="1rem">
<RadzenFormField Text="First Name">
<RadzenTextBox @bind-Value=@model.FirstName />
</RadzenFormField>
<RadzenFormField Text="Last Name">
<RadzenTextBox @bind-Value=@model.LastName />
</RadzenFormField>
</RadzenStack>
</RadzenFieldset>
Collapsible fieldset:
<RadzenFieldset Text="Advanced Options" Icon="settings" AllowCollapse="true">
Advanced configuration fields...
</RadzenFieldset>
Constructors
RadzenFieldset()
A fieldset container component that groups related form fields with a legend/header and optional collapse functionality. RadzenFieldset provides semantic form grouping with visual borders, useful for organizing complex forms into logical sections. Fieldsets are HTML form elements that semantically group related inputs, improving form structure and accessibility. Features visual and semantic grouping of related form fields, customizable header via Text or HeaderTemplate, optional expand/collapse to hide/show grouped fields, optional icon in the legend, optional summary content shown when collapsed, and screen reader announcement of fieldset legends for grouped fields. Use to organize forms into sections like "Personal Information", "Address", "Payment Details". When AllowCollapse is enabled, users can collapse sections they don't need to see.
Declaration
public RadzenFieldset()
Examples
Basic fieldset grouping form fields:
<RadzenFieldset Text="Personal Information">
<RadzenStack Gap="1rem">
<RadzenFormField Text="First Name">
<RadzenTextBox @bind-Value=@model.FirstName />
</RadzenFormField>
<RadzenFormField Text="Last Name">
<RadzenTextBox @bind-Value=@model.LastName />
</RadzenFormField>
</RadzenStack>
</RadzenFieldset>
Collapsible fieldset:
<RadzenFieldset Text="Advanced Options" Icon="settings" AllowCollapse="true">
Advanced configuration fields...
</RadzenFieldset>
Properties
AllowCollapse
Gets or sets a value indicating whether collapsing is allowed. Set to false by default.
Declaration
[Parameter]
public bool AllowCollapse { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
ChildContent
Gets or sets the child content.
Declaration
[Parameter]
public RenderFragment ChildContent { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderFragment | The child content. |
Collapse
Gets or sets the collapse callback.
Declaration
[Parameter]
public EventCallback Collapse { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback | The collapse callback. |
CollapseAriaLabel
Gets or sets the aria-label attribute of the collapse button.
Declaration
[Parameter]
public string CollapseAriaLabel { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The aria-label attribute value of the collapse button. |
CollapseTitle
Gets or sets the title attribute of the collapse button.
Declaration
[Parameter]
public string CollapseTitle { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The title attribute value of the collapse button. |
Collapsed
Gets or sets a value indicating whether this RadzenFieldset is collapsed.
Declaration
[Parameter]
public bool Collapsed { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Expand
Gets or sets the expand callback.
Declaration
[Parameter]
public EventCallback Expand { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback | The expand callback. |
ExpandAriaLabel
Gets or sets the aria-label attribute of the expand button.
Declaration
[Parameter]
public string ExpandAriaLabel { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The aria-label attribute value of the expand button. |
ExpandTitle
Gets or sets the title attribute of the expand button.
Declaration
[Parameter]
public string ExpandTitle { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The title attribute value of the expand button. |
HeaderTemplate
Gets or sets the header template.
Declaration
[Parameter]
public RenderFragment HeaderTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderFragment | The header template. |
Icon
Gets or sets the icon.
Declaration
[Parameter]
public string Icon { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The icon. |
IconColor
Gets or sets the icon color.
Declaration
[Parameter]
public string IconColor { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The icon color. |
SummaryTemplate
Gets or sets the summary template.
Declaration
[Parameter]
public RenderFragment SummaryTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderFragment | The summary template. |
Text
Gets or sets the text.
Declaration
[Parameter]
public string Text { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The text. |
Methods
BuildRenderTree(RenderTreeBuilder)
A fieldset container component that groups related form fields with a legend/header and optional collapse functionality. RadzenFieldset provides semantic form grouping with visual borders, useful for organizing complex forms into logical sections. Fieldsets are HTML form elements that semantically group related inputs, improving form structure and accessibility. Features visual and semantic grouping of related form fields, customizable header via Text or HeaderTemplate, optional expand/collapse to hide/show grouped fields, optional icon in the legend, optional summary content shown when collapsed, and screen reader announcement of fieldset legends for grouped fields. Use to organize forms into sections like "Personal Information", "Address", "Payment Details". When AllowCollapse is enabled, users can collapse sections they don't need to see.
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderTreeBuilder | __builder |
Overrides
GetComponentCssClass()
Gets the component CSS class.
Declaration
protected override string GetComponentCssClass()
Returns
| Type | Description |
|---|---|
| string |
Overrides
OnInitialized()
Called by the Blazor runtime.
Declaration
protected override void OnInitialized()
Overrides
SetParametersAsync(ParameterView)
Called by the Blazor runtime when parameters are set.
Declaration
public override Task SetParametersAsync(ParameterView parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| ParameterView | parameters | The parameters. |
Returns
| Type | Description |
|---|---|
| Task |