-
Notifications
You must be signed in to change notification settings - Fork 79
chore(Kb): kb for add tooltip to each chip in chiplist #3082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+84
−0
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6f9727c
chore(Kb): kb for add tooltip to each chip in chiplist
Tsvetomir-Hr 1375655
Update knowledge-base/chiplist-add-chip-tooltips.md
Tsvetomir-Hr 950d76e
Update knowledge-base/chiplist-add-chip-tooltips.md
Tsvetomir-Hr 4c5b70e
Update knowledge-base/chiplist-add-chip-tooltips.md
Tsvetomir-Hr 0a77e02
Update knowledge-base/chiplist-add-chip-tooltips.md
Tsvetomir-Hr de5f1e9
chore(Kb): polish article and add reference to chiplist templates
Tsvetomir-Hr 5df3325
chore(KB): update icon declaration
Tsvetomir-Hr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
title: Display Tooltip for Each Chip in a Telerik ChipList | ||
description: Learn how to display tooltips for chips in the Telerik Blazor ChipList component. | ||
type: how-to | ||
page_title: How to Display Tooltips for Chips in Telerik Blazor ChipList | ||
meta_title: How to Display Tooltips for Chips in Telerik Blazor ChipList | ||
slug: chiplist-kb-add-chip-tooltips | ||
tags: blazor, chiplist, tooltip, template | ||
res_type: kb | ||
ticketid: 1691888 | ||
--- | ||
|
||
## Environment | ||
|
||
<table> | ||
<tbody> | ||
<tr> | ||
<td>Product</td> | ||
<td>Telerik UI for Blazor ChipList</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
## Description | ||
|
||
You can display additional information for each chip in the [ChipList](slug:chiplist-overview) by showing a Tooltip. This approach helps you keep the chip text concise while providing more details on hover. | ||
|
||
This article answers the following questions: | ||
- How do you show extra details for chips in a ChipList? | ||
- Can you display a TelerikTooltip for each chip in the ChipList? | ||
- How do you use [`ItemTemplate`](slug:chiplist-templates) in Telerik Blazor ChipList? | ||
|
||
## Solution | ||
|
||
To add tooltips to chips in the ChipList, use the `ItemTemplate` to customize chip rendering and set a tooltip for each chip. Follow these steps: | ||
|
||
1. Add a `Description` property to the model used for the ChipList. | ||
2. Use the `ItemTemplate` to render each chip and set the `title` attribute for a native tooltip. | ||
3. Optionally, use the `TelerikTooltip` component for enhanced tooltip appearance and behavior. | ||
|
||
**Example: Displaying Tooltips for Chips** | ||
|
||
```razor | ||
<TelerikChipList Data="@ChipListSource"> | ||
<ItemTemplate> | ||
<div title="@context.Description" class="chip-description"> | ||
<TelerikSvgIcon Icon="@context.Icon"></TelerikSvgIcon> | ||
@context.Text | ||
</div> | ||
</ItemTemplate> | ||
</TelerikChipList> | ||
|
||
<TelerikTooltip TargetSelector=".chip-description" /> | ||
|
||
@code { | ||
private List<ChipModel> ChipListSource { get; set; } = new List<ChipModel> | ||
{ | ||
new ChipModel | ||
{ | ||
Text = "Audio", | ||
Icon = SvgIcon.FileAudio, | ||
Description = "Audio file chip." | ||
}, | ||
new ChipModel | ||
{ | ||
Text = "Video", | ||
Icon = SvgIcon.FileVideo, | ||
Description = "Video file chip." | ||
} | ||
}; | ||
|
||
public class ChipModel | ||
{ | ||
public string Text { get; set; } | ||
public ISvgIcon? Icon { get; set; } | ||
public string Description { get; set; } | ||
} | ||
} | ||
``` | ||
|
||
## See Also | ||
- [ChipList Overview](slug:chiplist-overview) | ||
- [ChipList Templates](slug:chiplist-templates#item-template) | ||
- [Tooltip Overview](slug:tooltip-overview) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.