New to Telerik UI for Blazor? Download free 30-day trial

ChipList Templates

The ChipList component allows you to change what is rendered in the chip. This article explains the built-in templates in the Blazor ChipList.

Item Template

The <ItemTemplate> allows you to control the rendering of the chips in the ChipList. This template receives a context argument that represents the current item.

<TelerikChipList Data="@ChipListSource">
    <ItemTemplate>
        @{
            <div>
                <TelerikFontIcon Icon="@context.Icon"></TelerikFontIcon>
                Item: @context.Text
            </div>
        }
    </ItemTemplate>
</TelerikChipList>

@code {
    private IEnumerable<ChipModel> ChipListSelectedItems { get; set; } = new List<ChipModel>();

    private List<ChipModel> ChipListSource { get; set; } = new List<ChipModel>()
    {
        new ChipModel()
        {
            Text = "Audio",
            Icon = FontIcon.FileAudio
        },
        new ChipModel()
        {
            Text = "Video",
            Icon = FontIcon.FileVideo
        }
    };

    public class ChipModel
    {
        public string Text { get; set; }
        public FontIcon? Icon { get; set; }
    }
}

See Also

In this article