Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions knowledge-base/chiplist-add-chip-tooltips.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
title: Adding Tooltips for Chips in a ChipList
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider "Add" instead of "Adding". You don't google with "-ing"

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: add-tooltips-chips-chiplist
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The slug is normally the same as the md file, but there is -kb- between the main component name and the rest.

Suggested change
slug: add-tooltips-chips-chiplist
slug: chiplist-kb-add-chip-tooltips

tags: blazor, chiplist, tooltip, itemtemplate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tags: blazor, chiplist, tooltip, itemtemplate
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.
Copy link
Contributor

@dimodi dimodi Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also link to the Tooltip Overview here.

Suggested change
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.
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` 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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to ChipList Templates here.


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; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can make this compatible with both SVG and Font icons.

Suggested change
public ISvgIcon Icon { get; set; }
public object? 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)