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
+17-20Lines changed: 17 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -549,46 +549,43 @@ 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
-
As you probably have already noticed, list items do not provide selection states. However, if your application requires your list to keep track of which item is selected, we give you an example of how this can be achieved. All you need to do is keep track of the state somewhere in your component, or in the data the list is bound to.
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.
553
553
554
-
Here's an example, in which we apply a background color to the list according to the theme's secondary 500 color, based on state tracking coming from the data the list is bound to:
554
+
Here's an example, in which by using the `selected` property we apply a background color to the list items that we select:
What we are doing is we are adding an additional `selected` property to each data member, which defaults to `false`. Upon list item click, we're resetting all the `selected` properties in the data collection and setting the one corresponding to the clicked item to `true`. Based on the selected property, we're applying a css class to the list item which gives it the selected background.
561
+
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."
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.
If you prefer to use the list theming function, there are parameters available that allow you to style the selected state of the list items. You can find more information about these parameters here: [`list-theme`]({environment:sassApiUrl}/index.html#function-list-theme)
Copy file name to clipboardExpand all lines: en/components/themes/palettes.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,11 +107,11 @@ Apart from having a single global palette, you can also create several palettes
107
107
/* styles.css */
108
108
109
109
.blue-theme {
110
-
--ig-primary-500: #0008ff;
110
+
--ig-primary-500: #0008ff;
111
111
}
112
112
113
113
.red-theme {
114
-
--ig-primary-500: #ff0400;
114
+
--ig-primary-500: #ff0400;
115
115
}
116
116
```
117
117
@@ -172,12 +172,13 @@ Be mindful when changing the `gray` and `surface` color variants as they are use
172
172
173
173
So far we've covered the `primary`, `secondary`, `gray`, and `surface` color variants and how you can override them. There are four more colors - `info`, `success`, `warn`, and `error`. They are usually used to set the colors in different states. For example, the `igx-input-group` component uses these colors in its input validation states.
174
174
They can be changed as the other color variants, all we need to do it to set the `500` variant and all of the other varints will be generated.
0 commit comments