Collapsible

in namespace DotVVM.Bootstrap5.Controls

Renders a content that can be shown and hidden.

Usage & Scenarios

A Bootstrap collapse element.

https://getbootstrap.com/docs/5.2/components/collapse/

Sample 1: Basic Collapsible

Put the collapsible content inside the control.

The IsExpanded property specifies whether the content is collapsed or expanded. The easiest way to expand or collapse is to use a link or button and switch the property using Static Command Binding.

<dot:LinkButton Click="{staticCommand: IsExpanded = !IsExpanded}" Text="Expand or collapse" />

<bs:Collapsible IsExpanded="{value: IsExpanded}">
  Collapsible content
</bs:Collapsible>
public class ViewModel
{
    public bool IsExpanded { get; set; }

}

Properties

Name Type Description Notes Default Value
property icon Content List<DotvvmControl> Gets or sets the content inside the collapsible element.
attribute
inner element
static value
bindable
default
null
property icon IsExpanded IValueBinding<Boolean> Gets or sets whether the content is collapsed or not.
attribute
inner element
static value
bindable
default
null
property icon Visible Boolean Gets or sets whether the control is visible. When set to false, `style="display: none"` will be added to this control.
attribute
inner element
static value
bindable
default
True

HTML produced by the control