CollapsiblePanel

in namespace DotVVM.Bootstrap5.Controls

Renders a collapsible Card.

Usage & Scenarios

Combines Collapsible and Card into control with always visible header and collapsible content (+ footer).

Sample 1: Simple Collapsible Panel

The Collapsible panel has the same API as Card. The difference is that only Header is visible when Collapsible panel is collapsed.

Collapsible panel can be collapsed/expanded by clicking on the header or using the IsExpanded property.

<bs:CollapsiblePanel HeaderText="Always displayed header" Text="Text which is hidden when collapsed." FooterText="Footer which is hidden when collapsed." />

<bs:CollapsiblePanel>
    <HeaderTemplate>
        <bs:Icon Type="check" />
        Always displayed header
    </HeaderTemplate>
    <Content>
        <bs:CardBody>
           Custom CardBody text which is hidden when collapsed.
        </bs:CardBody>
    </Content>
    <FooterTemplate>
        Custom footer which is hidden when collapsed.
    </FooterTemplate>
</bs:CollapsiblePanel>

Sample 2: IsExpanded binding

Use IsExpanded to control state of collapsible panel programmatically.

IsExpanded property can be also use to set the initial state of Collapsible Panel.

<bs:CollapsiblePanel IsExpanded="{value: IsExpanded}" HeaderText="Always displayed header" Text="Text which is hidden when collapsed." />
<bs:CheckBox Checked="{value: IsExpanded}" Text="Is expanded" />
public class ViewModel : DotvvmViewModelBase
{
    public bool IsExpanded { get; set; }
}

Properties

Name Type Description Notes Default Value
property icon BorderColor BootstrapColor Gets or sets the card border color.
attribute
inner element
static value
bindable
default
null
property icon Color CardColor Gets or sets the card color. Both the background and text color css classes are set.
attribute
inner element
static value
bindable
default
null
property icon Content List<ICardItem> Gets or sets the card content.
attribute
inner element
static value
bindable
default
null
property icon FooterTemplate ITemplate Gets or sets a custom template for panel footer.
attribute
inner element
static value
bindable
default
null
property icon FooterText String Gets or sets a plain text for panel footer.
attribute
inner element
static value
bindable
default
null
property icon HeaderTemplate ITemplate Gets or sets a custom template for panel header.
attribute
inner element
static value
bindable
default
null
property icon HeaderText String Gets or sets a plain text for panel header.
attribute
inner element
static value
bindable
default
null
property icon IsExpanded IValueBinding<Boolean> Gets or sets whether the panel content is collapsed or not.
attribute
inner element
static value
bindable
default
null
property icon SubtitleText String Gets or sets the control subtitle text. H6 tag is used.
attribute
inner element
static value
bindable
default
null
property icon Text String Gets or sets the card text content. This property cannot be combined with `Content` property.
attribute
inner element
static value
bindable
default
null
property icon TitleText String Gets or sets the control title text. H5 tag is used.
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