CardListGroup

in namespace DotVVM.Bootstrap5.Controls

Renders list group inside the card component.

Usage & Scenarios

A special version of the ListGroup control that can be used in Card.

See ListGroup for more info on how to use this control.

https://getbootstrap.com/docs/5.2/components/card/#list-groups

Sample 2: Card with images and lists

The card can contain images or lists. Use any combination of CardBody, CardImage and CardListGroup controls.

<bs:Card>
  <bs:CardListGroup DataSource="{value: Texts}" ItemText="{value: _this}" />
  <bs:CardListGroup class="mb-1">
    <bs:ListGroupText Text="Item 1" />
    <bs:ListGroupText Text="Item 2" />
    <bs:ListGroupText Text="Item 3" />
    <bs:ListGroupText Text="Item 4" />
  </bs:CardListGroup>
</bs:Card>
public class ViewModel : DotvvmViewModelBase
{

    public string[] Texts { get; } = new[] { "red", "green", "blue" };

    public void DoSomething() 
    {

    }
}

Properties

Name Type Description Notes Default Value
property icon DataSource IValueBinding<IEnumerable<Object>> Gets or sets a data-source object from which the child controls will be generated.
attribute
inner element
static value
bindable
default
null
property icon ForceVerticalOrientationBreakpoint ResponsiveBreakpoints Sets a breakpoint when ListGroup is changed from horizontal to vertical.
attribute
inner element
static value
bindable
default
None
property icon GroupTypes ListGroupType[] Gets or sets the types of the ListGroup. Possible values are `Numbered` or `Flush` or both.
attribute
inner element
static value
bindable
default
null
property icon ItemBadgeTemplate ITemplate Gets or sets a custom template for a Badge control inside a ListGroupItem when DataSource is set.
attribute
inner element
static value
bindable
default
null
property icon ItemBadgeText String Gets or sets a plain text for a Badge control inside a ListGroupItem when DataSource is set.
attribute
inner element
static value
bindable
default
null
property icon ItemBadgeType BadgeColor Gets or sets a badge color when DataSource is set.
attribute
inner element
static value
bindable
default
Primary
property icon ItemBadgeVisualStyle BadgeVisualStyle Gets or sets a badge visual style when DataSource is set. Possible values are `Default` or `Pill`.
attribute
inner element
static value
bindable
default
Default
property icon ItemColor ListGroupItemColor Gets or sets a ListGroupItem color when DataSource is set.
attribute
inner element
static value
bindable
default
Default
property icon ItemEnabled Boolean Gets or sets a ListGroupItem disabled state when DataSource is set.
attribute
inner element
static value
bindable
default
True
property icon ItemIsJustified Boolean When DataSource is set, adds `justify-content-between` and `align-items-center` CSS classes when DataSource is set.
attribute
inner element
static value
bindable
default
False
property icon ItemNavigateUrl String Gets or sets a navigation URL for `Link` ListGroupItem when DataSource is set.
attribute
inner element
static value
bindable
default
null
property icon ItemRouteName String Gets or sets a route name when DataSource is set.
attribute
inner element
static value
bindable
default
null
property icon Items List<IListGroupItem> Gets or sets the items inside the control.
attribute
inner element
static value
bindable
default
null
property icon ItemSelected Boolean Gets or sets whether ListGroupItem control is selected when DataSource is set.
attribute
inner element
static value
bindable
default
null
property icon ItemTemplate ITemplate Gets or sets a custom template for a ListGroupItem control when DataSource is set.
attribute
inner element
static value
bindable
default
null
property icon ItemText String Gets or sets a plain text for a ListGroupItem control when DataSource is set.
attribute
inner element
static value
bindable
default
null
property icon ItemType ListGroupItemType Gets or sets a type for a ListGroupItem control when DataSource is set.
attribute
inner element
static value
bindable
default
Default
property icon ItemUrlSuffix String Gets or sets a URL suffix for a `Link` ListGroupItem control when DataSource is set.
attribute
inner element
static value
bindable
default
null
property icon Orientation ListGroupOrientation Gets or sets a ListGroup orientation.
attribute
inner element
static value
bindable
default
Vertical
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

Events

Name Type Description
event icon ItemClick ICommandBinding Gets or sets the command that will be triggered when a `Button` ListGroupItem is clicked. DataSource must be is set.

HTML produced by the control