Search...

ListGroup

Contrast Angular Bootstrap ListGroup

Contrast Angular Bootstrap List group is a flexible component which displays not only simple list of elements but complex custom content.

Importing the Contrast Angular Bootstrap ListGroup Module

To use the Contrast Angular Bootstrap ListGroup component in your project you need to import ListGroupModule.

ts
import { ListgroupModule } from 'cdbangular';

Default LIstGroup

The CDBListGroupItem component is a single list item in a CDBListGroup.

Angular Bootstrap ListGroup Default

HTML
html
<CDBListGroup style="width: 30rem">
<CDBListGroupItem>List Group </CDBListGroupItem>
<CDBListGroupItem>List Group</CDBListGroupItem>
<CDBListGroupItem>List Group</CDBListGroupItem>
<CDBListGroupItem>List Group</CDBListGroupItem>
<CDBListGroupItem>List Group</CDBListGroupItem>
<CDBListGroupItem>List Group</CDBListGroupItem>
</CDBListGroup>

Passing the CDBLIstGroupItem a href attribute makes the list group item act like an a tag.

Angular Bootstrap ListGroup as Link

HTML
html
<CDBListGroup style="width: 30rem">
<CDBListGroupItem href="/" [active]="true">
List Group
</CDBListGroupItem>
<CDBListGroupItem href="/" [hover]="true">
List Group
</CDBListGroupItem>
<CDBListGroupItem href="/" [hover]="true">
List Group
</CDBListGroupItem>
<CDBListGroupItem href="/" [hover]="true">
List Group
</CDBListGroupItem>
<CDBListGroupItem href="/" [hover]="true">
List Group Link
</CDBListGroupItem>
<CDBListGroupItem href="/" [hover]="true">
List Group
</CDBListGroupItem>
</CDBListGroup>

Label

Use the CDBBadge component to put labels in our list group.

Angular Bootstrap ListGroup Label

HTML
html
<CDBListGroup style="width: 30rem">
<CDBListGroupItem class="d-flex justify-content-between align-items-center">
List Group <CDBBadge color="primary">19</CDBBadge>
</CDBListGroupItem>
<CDBListGroupItem class="d-flex justify-content-between align-items-center">
List Group
<CDBBadge color="secondary">19</CDBBadge>
</CDBListGroupItem>
<CDBListGroupItem class="d-flex justify-content-between align-items-center">
List Group
<CDBBadge color="success">19</CDBBadge>
</CDBListGroupItem>
<CDBListGroupItem class="d-flex justify-content-between align-items-center">
List Group
<CDBBadge color="danger">19</CDBBadge>
</CDBListGroupItem>
<CDBListGroupItem class="d-flex justify-content-between align-items-center">
List Group<CDBBadge color="info">19</CDBBadge>
</CDBListGroupItem>
<CDBListGroupItem class="d-flex justify-content-between align-items-center">
List Group<CDBBadge color="warning">19</CDBBadge>
</CDBListGroupItem>
</CDBListGroup>

Color List Group

Use the color prop to give your list group a background color.

Angular Bootstrap ListGroup Color

HTML
html
<CDBListGroup style="width: 30rem">
<CDBListGroupItem color="primary">List Group </CDBListGroupItem>
<CDBListGroupItem color="secondary">List Group</CDBListGroupItem>
<CDBListGroupItem color="success">List Group</CDBListGroupItem>
<CDBListGroupItem color="danger">List Group</CDBListGroupItem>
<CDBListGroupItem color="info">List Group Link</CDBListGroupItem>
<CDBListGroupItem color="warning">List Group</CDBListGroupItem>
</CDBListGroup>

Icons

We nest the component in our CDBListGrpupItem to have icons in our list group.

Angular Bootstrap ListGroup Icons

HTML
html
<CDBListGroup style="width: 30rem">
<CDBListGroupItem>
<CDBIcon [fab]="true" icon="facebook" class="me-3"></CDBIcon>
List Group
</CDBListGroupItem>
<CDBListGroupItem>
<CDBIcon [fab]="true" icon="facebook" size="2x" class="me-3"></CDBIcon>
List Group
</CDBListGroupItem>
<CDBListGroupItem>
<CDBIcon [fab]="true" icon="facebook" size="2x" class="me-3"></CDBIcon>
List Group
</CDBListGroupItem>
<CDBListGroupItem>
<CDBIcon [fab]="true" icon="facebook" size="2x" class="me-3"></CDBIcon>
List Group
</CDBListGroupItem>
<CDBListGroupItem>
<CDBIcon [fab]="true" icon="facebook" size="2x" class="me-3"></CDBIcon>
List Group
</CDBListGroupItem>
<CDBListGroupItem>
<CDBIcon [fab]="true" icon="facebook" size="2x" class="me-3"></CDBIcon>
List Group
</CDBListGroupItem>
</CDBListGroup>

API

This section will build on your information about the props you get to use with the Contrast Angular Bootstrap ListGroup component. You will find out what these props do, their default values, and how you would use them in your code.

API Reference: Contrast Angular Bootstrap ListGroup Props

The table below lists other prop options of the CDBListGroup component.

NameTypeDefaultDescriptionExample
classStringAdds custom classesclass="myClass"

API Reference: Contrast Angular Bootstrap LIstGroupItem Properties

The table below lists other prop options of the CDBListGroupItem component.

NameTypeDefaultDescriptionExample
classStringAdds custom classesclass="myClass"
activeBooleanfalseAdds default active state to itemactive=true
colorStringChanges Item background and text color, accepts ["primary", "default", "secondary", "success", "dark", "danger", "info", "warning", "white" ]color="primary"
disableBooleanfalseDisables item from being clickeddisabled=true
hoverBooleanfalseAdds hover effect (slightly background color change)hover=true

Build modern projects using Bootstrap 5 and Contrast

Trying to create components and pages for a web app or website from scratch while maintaining a modern User interface can be very tedious. This is why we created Contrast, to help drastically reduce the amount of time we spend doing that. so we can focus on building some other aspects of the project.

Contrast Bootstrap PRO consists of a Premium UI Kit Library featuring over 10000+ component variants. Which even comes bundled together with its own admin template comprising of 5 admin dashboards and 23+ additional admin and multipurpose pages for building almost any type of website or web app.
See a demo and learn more about Contrast Bootstrap Pro by clicking here.