New to Telerik UI for BlazorStart a free 30-day trial

Telerik ExpansionPanel component for Blazor applications, providing a collapsible container with customizable header and content. Use this component to organize content into expandable sections and improve page structure, readability, and space efficiency.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

C#
public class TelerikExpansionPanel : BaseComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Inheritance: objectComponentBaseBaseComponentTelerikExpansionPanel

Implements: IComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members BaseComponent.ShouldRender()BaseComponent.OnInitializedAsync()BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeVoidAsyncWithoutAwait(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.OnInitialized()ComponentBase.OnParametersSet()ComponentBase.OnParametersSetAsync()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)ComponentBase.SetParametersAsync(ParameterView)...

Constructors

C#
public TelerikExpansionPanel()

Properties

Sets the animation duration in milliseconds. Default is 300.

C#
[Parameter]
public int AnimationDuration { get; set; }

The content of the expansion panel.

C#
[Parameter]
public RenderFragment? ChildContent { get; set; }

The icon to be displayed when the expansion panel is expanded.

C#
[Parameter]
public object? CollapseIcon { get; set; }

The content of the expansion panel. Takes precedence over the ChildContent parameter.

C#
[Parameter]
public RenderFragment? Content { get; set; }

Indicates whether the expansion panel is enabled. If set to false, the expansion panel will be disabled and not respond to user interactions.

C#
[Parameter]
public bool Enabled { get; set; }

Indicates whether the initial state of the expansion panel is expanded.

C#
[Parameter]
public bool Expanded { get; set; }

Fires when the expansion panel changes its expanded state.

C#
[Parameter]
public EventCallback<bool> ExpandedChanged { get; set; }

The icon to be displayed when the expansion panel is collapsed.

C#
[Parameter]
public object? ExpandIcon { get; set; }

Defines the height of the component.

C#
[Parameter]
public string? Height { get; set; }

The unique identifier of the expansion panel.

C#
[Parameter]
public string? Id { get; set; }

The subtitle of the expansion panel.

C#
[Parameter]
public string? SubTitle { get; set; }

The custom subtitle content of the expansion panel. Takes precedence over the SubTitle parameter.

C#
[Parameter]
public RenderFragment? SubTitleTemplate { get; set; }

The title of the expansion panel.

C#
[Parameter]
public string? Title { get; set; }

The custom title content of the expansion panel. Takes precedence over the Title parameter.

C#
[Parameter]
public RenderFragment? TitleTemplate { get; set; }

Indicates whether the expansion panel is toggleable. If set to false, the expansion panel will not respond to user interactions.

C#
[Parameter]
public bool Toggleable { get; set; }

Defines the width of the component.

C#
[Parameter]
public string? Width { get; set; }

Methods

C#
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters:__builderRenderTreeBuilder

Overrides: ComponentBase.BuildRenderTree(RenderTreeBuilder)

C#
public Task CollapseAsync()
Returns:

Task

C#
public override void Dispose()

Overrides: BaseComponent.Dispose()

C#
public Task ExpandAsync()
Returns:

Task

C#
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters:firstRenderboolReturns:

Task

Overrides: BaseComponent.OnAfterRenderAsync(bool)

Toggles the expansion state of the panel. If the panel is currently expanded, it will collapse; if it is collapsed, it will expand.

C#
public Task ToggleAsync()
Returns:

Task