A collapsible panel component with customizable header, content, summary, and footer sections. RadzenPanel provides an expandable/collapsible container for organizing and hiding content, ideal for settings panels, detail sections, or grouped information. Displays content in a structured container with optional collapsing functionality. When AllowCollapse is enabled, users can click the header to toggle the panel's expanded/collapsed state. Supports customizable header via HeaderTemplate/Text/Icon properties, main panel body via ChildContent, optional summary content shown when collapsed (SummaryTemplate), optional footer section (FooterTemplate), Collapsed property with two-way binding for programmatic control, and Expand/Collapse event callbacks. The header displays a collapse/expand icon when AllowCollapse is true, and users can click anywhere on the header to toggle.
IComponent
IHandleEvent
IHandleAfterRender
RadzenComponentWithChildren.ChildContent
RadzenComponent.OnAfterRenderAsync
RadzenComponent.RaiseContextMenu
RadzenComponent.RaiseMouseEnter
RadzenComponent.AddContextMenu
RadzenComponent.RaiseMouseLeave
RadzenComponent.OnBecameInvisible
RadzenComponent.DefaultCulture
RadzenComponent.IsJSRuntimeAvailable
ComponentBase.OnInitializedAsync
ComponentBase.OnParametersSet
ComponentBase.OnParametersSetAsync
ComponentBase.StateHasChanged
ComponentBase.ShouldRender
ComponentBase.OnAfterRender
ComponentBase.InvokeAsync
ComponentBase.DispatchExceptionAsync
ComponentBase.RendererInfo
ComponentBase.Assets
ComponentBase.AssignedRenderMode
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
public class RadzenPanel : RadzenComponentWithChildren, IComponent, IHandleEvent, IHandleAfterRenderBasic collapsible panel:
<RadzenPanel Text="Advanced Options" Icon="settings" AllowCollapse="true">
<RadzenStack Gap="1rem">
<RadzenCheckBox @bind-Value=@option1 Text="Option 1" />
<RadzenCheckBox @bind-Value=@option2 Text="Option 2" />
</RadzenStack>
</RadzenPanel>
Panel with custom templates and events:
<RadzenPanel AllowCollapse="true" @bind-Collapsed=@isCollapsed Expand=@OnExpand Collapse=@OnCollapse>
<HeaderTemplate>
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center">
<RadzenIcon Icon="info" />
<RadzenText TextStyle="TextStyle.H6">Details</RadzenText>
</RadzenStack>
</HeaderTemplate>
<ChildContent>
Detailed content here...
</ChildContent>
<SummaryTemplate>
<RadzenText TextStyle="TextStyle.Caption">Click to expand details</RadzenText>
</SummaryTemplate>
</RadzenPanel>
@code {
bool isCollapsed = false;
void OnExpand() => Console.WriteLine("Panel expanded");
void OnCollapse() => Console.WriteLine("Panel collapsed");
}A collapsible panel component with customizable header, content, summary, and footer sections. RadzenPanel provides an expandable/collapsible container for organizing and hiding content, ideal for settings panels, detail sections, or grouped information. Displays content in a structured container with optional collapsing functionality. When AllowCollapse is enabled, users can click the header to toggle the panel's expanded/collapsed state. Supports customizable header via HeaderTemplate/Text/Icon properties, main panel body via ChildContent, optional summary content shown when collapsed (SummaryTemplate), optional footer section (FooterTemplate), Collapsed property with two-way binding for programmatic control, and Expand/Collapse event callbacks. The header displays a collapse/expand icon when AllowCollapse is true, and users can click anywhere on the header to toggle.
public RadzenPanel()Gets or sets whether the panel can be collapsed by clicking its header. When enabled, a collapse/expand icon appears in the header, and clicking anywhere on the header toggles the panel state.
public bool AllowCollapse { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets whether the panel can be collapsed by clicking its header. When enabled, a collapse/expand icon appears in the header, and clicking anywhere on the header toggles the panel state. |
Gets or sets the callback invoked when the panel is collapsed from an expanded state. Useful for cleanup operations or tracking panel state changes.
public EventCallback Collapse { get; set; }
| Type | Description |
|---|---|
| EventCallback | Gets or sets the callback invoked when the panel is collapsed from an expanded state. Useful for cleanup operations or tracking panel state changes. |
Gets or sets the aria-label attribute of the collapse button.
public string CollapseAriaLabel { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the aria-label attribute of the collapse button. |
Gets or sets the title attribute of the collapse button.
public string CollapseTitle { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the title attribute of the collapse button. |
Gets or sets whether the panel is currently in a collapsed state. When collapsed, the main content is hidden and only the header (and optional SummaryTemplate) are visible. Use with @bind-Collapsed for two-way binding to programmatically control the panel state.
public bool Collapsed { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets whether the panel is currently in a collapsed state. When collapsed, the main content is hidden and only the header (and optional SummaryTemplate) are visible. Use with @bind-Collapsed for two-way binding to programmatically control the panel state. |
Gets or sets the callback invoked when the panel is expanded from a collapsed state. Useful for loading data on-demand or triggering animations when the panel opens.
public EventCallback Expand { get; set; }
| Type | Description |
|---|---|
| EventCallback | Gets or sets the callback invoked when the panel is expanded from a collapsed state. Useful for loading data on-demand or triggering animations when the panel opens. |
Gets or sets the aria-label attribute of the expand button.
public string ExpandAriaLabel { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the aria-label attribute of the expand button. |
Gets or sets the title attribute of the expand button.
public string ExpandTitle { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the title attribute of the expand button. |
Gets or sets the custom content for the panel header. When set, overrides the default header rendering (Text and Icon properties are ignored). Use this for complex headers with custom layouts, buttons, or other components.
public RenderFragment HeaderTemplate { get; set; }
| Type | Description |
|---|---|
| RenderFragment | Gets or sets the custom content for the panel header. When set, overrides the default header rendering (Text and Icon properties are ignored). Use this for complex headers with custom layouts, buttons, or other components. |
Gets or sets the Material icon name displayed in the panel header before the text. Use Material Symbols icon names (e.g., "settings", "info", "warning").
public string Icon { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the Material icon name displayed in the panel header before the text. Use Material Symbols icon names (e.g., "settings", "info", "warning"). |
Gets or sets a custom color for the header icon. Supports any valid CSS color value. If not set, uses the theme's default icon color.
public string IconColor { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets a custom color for the header icon. Supports any valid CSS color value. If not set, uses the theme's default icon color. |
Gets or sets the summary content displayed when the panel is collapsed. This optional content appears below the header in collapsed state, providing a preview or summary of the hidden content. When the panel is expanded, this content is not displayed.
public RenderFragment SummaryTemplate { get; set; }
| Type | Description |
|---|---|
| RenderFragment | Gets or sets the summary content displayed when the panel is collapsed. This optional content appears below the header in collapsed state, providing a preview or summary of the hidden content. When the panel is expanded, this content is not displayed. |
Gets or sets the text displayed in the panel header. This appears as the panel title. For more complex headers, use HeaderTemplate instead.
public string Text { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the text displayed in the panel header. This appears as the panel title. For more complex headers, use HeaderTemplate instead. |
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
| Type | Name | Description |
|---|---|---|
| Rendering.RenderTreeBuilder | __builder |
protected override string GetComponentCssClass()
| Type | Description |
|---|---|
| string |
public override Task SetParametersAsync(ParameterView parameters)
| Type | Name | Description |
|---|---|---|
| ParameterView | parameters |
| Type | Description |
|---|---|
| Task |