You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/components/list.md
+15-6Lines changed: 15 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -549,16 +549,16 @@ Finally, we need to apply the filtering pipe to our contacts data before we can
549
549
550
550
## List Item Selection
551
551
552
-
The list items have a `selected`state property that helps us track which items have been selected. This property allows us to identify and manage the selection status of each item.
552
+
The list items have a `selected` property that helps us track which items are "selected". This property allows us to identify and manage the selection status of each item.
553
553
554
-
Here's an example, in which by using the `selected` property we apply a background color to the list items that we select:
554
+
Here's an example illustrating how the visual style of the items changes when using the `selected` property:
To make list items selectable, we simply need to add the `selected` property value to each list item we want to be able to select. By default, this property will be set to `false`. Then, we add a `(click)` event to each list item, which will toggle the `selected` property value between `true` and `false`, effectively switching the selection state each time the item is clicked."
561
+
By default, the `selected` property is set to `false`. We can toggle its value using an inline expression bound to the `(click)` event on each list item, effectively switching the visual state of the item each time it's clicked.
562
562
563
563
```html
564
564
<igx-list>
@@ -576,11 +576,20 @@ To make list items selectable, we simply need to add the `selected` property val
576
576
</igx-list>
577
577
```
578
578
579
-
When a list item is selected, the class `.igx-list__item-base--selected` is added to the element. We can use this class to style the selected state of the element.
579
+
The list item also exposes a few CSS variables which you can use to style different parts of the selected elements:
0 commit comments