ListGroupText
in namespace DotVVM.Bootstrap5.Controls
Represents a text item in the ListGroup control.
Usage & Scenarios
Represents an item in ListGroup.
This control share some properties with ListGroupLinkItem and ListGroupTextItem, but has some additional ones:
Colorspecifies the Bootstrap color to be used for the list item.- Properties with a
Badgeprefix allow to specify a Badge control inside the list item to render additional content.
https://getbootstrap.com/docs/5.2/components/list-group/#links-and-buttons
Sample 1: ListGroupTextItem static items
ListGroupTextItem is very similar to ListGroupLinkItem, but generates a li tag instead of a tag. Visit ListGroup to see some examples with the DataSource property.
<bs:ListGroup>
<bs:ListGroupText>
<BadgeTemplate>
{{value: Text}}
</BadgeTemplate>
<Template>
<span>{{value: Text}}</span>
</Template>
</bs:ListGroupText>
<bs:ListGroupText Text="Item 2" />
<bs:ListGroupText Text="{value: Text}" />
</bs:ListGroup>
public class ViewModel : DotvvmViewModelBase
{
public string Text { get; set; } = "Data-bound text of the item.";
public bool Enabled { get; set; }
public bool IsSelected { get; set; }
public void ChangeListGroup()
{
Enabled = !Enabled;
IsSelected = !IsSelected;
Text = "Changed";
}
}
Properties
| Name | Type | Description | Notes | Default Value | |
|---|---|---|---|---|---|
| BadgeTemplate | ITemplate | Gets or sets a custom template for a Badge control inside a ListGroupItem. |
inner element
static value
|
null | |
| BadgeText | String | Gets or sets a plain text for a Badge control inside a ListGroupItem. |
attribute
static value
bindable
|
null | |
| BadgeType | BadgeColor | Gets or sets a badge color. |
attribute
static value
bindable
|
Primary | |
| BadgeVisualStyle | BadgeVisualStyle | Gets or sets a badge visual style. Possible values are `Default` Badge control or `Pill`. |
attribute
static value
|
Default | |
| ClientIDMode | ClientIDMode | Gets or sets the client ID generation algorithm. |
attribute
static value
|
Static | |
| Color | ListGroupItemColor | Gets or sets a ListGroupItem color. |
attribute
static value
bindable
|
Default | |
| DataContext | Object | Gets or sets a data context for the control and its children. All value and command bindings are evaluated in context of this value. The DataContext is null in client-side templates. |
attribute
bindable
|
null | |
| Enabled | Boolean | Gets or sets a ListGroupItem disabled state. |
attribute
static value
bindable
|
True | |
| ID | String | Gets or sets the control client ID within its naming container. |
attribute
static value
bindable
|
null | |
| IncludeInPage | Boolean | Gets or sets whether the control is included in the DOM of the page. |
attribute
bindable
|
True | |
| IsJustified | Boolean | When DataSource is set, adds `justify-content-between` and `align-items-center` CSS classes. |
attribute
static value
|
False | |
| Selected | Boolean | Gets or sets if ListGroupItem control is selected. |
attribute
static value
bindable
|
null | |
| Template | ITemplate | Gets or sets a custom template for a ListGroupItem control. |
inner element
static value
default
|
null | |
| Text | String | Gets or sets a plain text for a ListGroupItem control. |
attribute
static value
bindable
|
null | |
| Visible | Boolean | Gets or sets whether the control is visible. When set to false, `style="display: none"` will be added to this control. |
attribute
static value
bindable
|
True |