Collapse
This documentation provides a comprehensive reference for the
Collapse component, guiding you through its configuration options.Screenshot #

Parameters #
| Name | Type | Default | Required | Description | Added Version |
|---|---|---|---|---|---|
| AdditionalAttributes | Dictionary<string, object>? | null | Gets or sets additional attributes that will be applied to the component. | 1.0.0 | |
| ChildContent | RenderFragment? | null | Gets or sets the content to be rendered within the component. | 1.7.0 | |
| Class | string? | null | Gets or sets the CSS class name(s) to apply to the component. | 1.0.0 | |
| Horizontal | bool | False | Gets or sets the horizontal collapsing. | 1.7.0 | |
| Id | string? | null | Gets or sets the ID. If not set, a unique ID will be generated. | 1.0.0 | |
| Parent | object? | null | Gets or sets the parent selector, DOM element. If parent is provided, then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior - this is dependent on the card class). The attribute has to be set on the target collapsible area. | 1.7.0 | |
| Style | string? | null | Gets or sets the CSS style string that defines the inline styles for the component. | 1.0.0 | |
| Toggle | bool | False | Toggles the collapsible element on invocation. | 1.7.0 |
Methods #
| Name | Return type | Description | Added Version |
|---|---|---|---|
| HideAsync() | Task | Hides a collapsible element. | 1.7.0 |
| ShowAsync() | Task | Shows a collapsible element. | 1.7.0 |
| ToggleAsync() | Task | Toggles a collapsible element to shown or hidden. | 1.7.0 |
Events #
| Name | Return Type | Description | Added Version |
|---|---|---|---|
| OnHidden | EventCallback | This event is fired when a collapse element has been hidden from the user (will wait for CSS transitions to complete). | 1.7.0 |
| OnHiding | EventCallback | This event is fired immediately when the hide method has been called. | 1.7.0 |
| OnShowing | EventCallback | This event fires immediately when the show instance method is called. | 1.7.0 |
| OnShown | EventCallback | This event is fired when a collapse element has been made visible to the user (will wait for CSS transitions to complete). | 1.7.0 |