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

Merged
merged 7 commits into from
Jul 8, 2025
Merged
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: 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)
Loading