Skip to content

Commit 0d5d5be

Browse files
committed
docs(ChipList): Add ThemeColorField parameter
1 parent 98db0ce commit 0d5d5be

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

components/chip/appearance.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ The `ThemeColor` parameter applies a predefined text color and background color.
144144
|`Success`|`success`|
145145
|`Warning`|`warning`|
146146
|`Error`|`error`|
147-
|`None`|`none`|
148147

149148
>caption The built-in ThemeColors
150149
@@ -162,7 +161,7 @@ The `ThemeColor` parameter applies a predefined text color and background color.
162161
<div style="float:left; margin: 20px;">
163162
<TelerikChip @bind-Selected="@IsChipSelected"
164163
ThemeColor="@themeColor"
165-
Text="Audio">
164+
Text="@themeColor">
166165
</TelerikChip>
167166
</div>
168167
}

components/chiplist/appearance.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ position: 35
1010

1111
# ChipList Appearance Settings
1212

13-
You can control the appearance of the chips in the ChipList by setting the following attributes:
13+
You can control the appearance of the chips in the ChipList by setting the following parameters:
1414

1515
* [FillMode](#fillmode)
1616
* [Rounded](#rounded)
1717
* [Size](#size)
1818

1919
You can use all of them together to achieve the desired appearance. This article will explain their effect one by one.
2020

21+
Also see how to [set `ThemeColor`](slug:chip-appearance#themecolor) for each [chip in the ChipList](slug:chiplist-bound).
22+
2123
## FillMode
2224

2325
The `FillMode` controls how the individual chip is filled. You can set it to a member of the `Telerik.Blazor.ThemeConstants.Chip.FillMode` class:
@@ -191,3 +193,7 @@ You can increase or decrease the size of the chips by setting the `Size` paramet
191193
````
192194

193195
@[template](/_contentTemplates/common/themebuilder-section.md#appearance-themebuilder)
196+
197+
## See Also
198+
199+
* [Set ThemeColor for each chip in the ChipList](slug:chiplist-bound)

components/chiplist/data-bind.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,34 @@ The ChipList has features that map to properties in the component model class. T
3030
Text = "Audio",
3131
Icon = SvgIcon.FileAudio,
3232
Disabled = false,
33-
Removable = true
33+
Removable = true,
34+
ThemeColor = ThemeConstants.Chip.ThemeColor.Base
3435
},
3536
new ChipModel()
3637
{
3738
Text = "Video",
3839
Icon = SvgIcon.FileVideo,
3940
Disabled = false,
40-
Removable = false
41+
Removable = false,
42+
ThemeColor = ThemeConstants.Chip.ThemeColor.Warning
4143
},
4244
new ChipModel()
4345
{
4446
Text = "Image",
4547
Icon = SvgIcon.FileImage,
4648
Disabled = true,
47-
Removable = false
49+
Removable = false,
50+
ThemeColor = ThemeConstants.Chip.ThemeColor.Info
4851
}
4952
};
5053
5154
public class ChipModel
5255
{
53-
public string Text { get; set; }
54-
public ISvgIcon Icon { get; set; }
56+
public string Text { get; set; } = string.Empty;
57+
public ISvgIcon? Icon { get; set; }
5558
public bool Disabled { get; set; }
5659
public bool Removable { get; set; }
60+
public string ThemeColor { get; set; } = string.Empty;
5761
}
5862
}
5963
````
@@ -68,6 +72,7 @@ The table below lists the available data binding parameters for the Blazor ChipL
6872
| `IconField` | `"Icon"` | The icon that renders in the chip. |
6973
| `TextField` | `"Text"` | The text that renders in the chip. |
7074
| `RemovableField`| `"Removable"` | Defines if the users can remove the chip. |
75+
| `ThemeColorField`| `"ThemeColor"` | Defines the [`ThemeColor` of each chip](slug:chip-appearance#themecolor). |
7176

7277
#### Icons
7378

components/chiplist/overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ The <a href="https://www.telerik.com/blazor-ui/chiplist" target="_blank">Blazor
5252

5353
## Data Binding
5454

55-
The Blazor ChipList requires a data source so that it can display items to the user. To provide a data source, use the `Data` property. [Read more about the Blazor ChipList data binding](slug:chiplist-bound).
55+
The Blazor ChipList requires a data source so that it can display items to the user. To provide a data source, use the `Data` property. Some properties of the ChipList model can enhance the behavior and appearance of each chip. [Read more about the Blazor ChipList data binding](slug:chiplist-bound).
5656

5757
## Selection
5858

@@ -68,7 +68,7 @@ You can use the built-in events of the Blazor ChipList to react to chip selectio
6868

6969
## Appearance
7070

71-
You can customize the appearance of the Blazor ChipList via a variety of built-in customization options. [Read more about the ChipList appearance settings...](slug:chiplist-appearance)
71+
You can customize the [appearance of the Blazor ChipList](slug:chiplist-appearance) via a variety of built-in customization options. Also see how to [set `ThemeColor`](slug:chip-appearance#themecolor) for each [chip in the ChipList](slug:chiplist-bound).
7272

7373
## ChipList Parameters
7474

@@ -82,7 +82,7 @@ The table below lists the ChipList parameters. Also check the [ChipList API Refe
8282
| `AriaLabelledBy` | `string` | Maps to the `area-labelledby` attribute. Use this parameter to reference another element to define its accessible name. |
8383
| `Class` | `string` | An additional CSS class for the `<div class="k-chip-list">` element. Use it to [customize the component styles and override the theme](slug:themes-override). |
8484
| `Data` | `IEnumerable<TItem>` | The collection of the items that will be rendered as chips. |
85-
| `Removable` | `bool` | Specifies if the chip can be removed by the user. If set to `true` a remove icon will be rendered on each available chip. |
85+
| `Removable` | `bool` | Specifies if the chips can be removed by the user. If set to `true` a remove icon will be rendered on each available chip. |
8686
| `RemoveIcon` | `object` | Defines the icon that will be rendered if the `Removable` parameter is set to `true`. |
8787

8888
## Next Steps

0 commit comments

Comments
 (0)