Unplanned
Last Updated: 24 Apr 2025 06:35 by ADMIN
Anislav
Created on: 23 Apr 2025 08:26
Category: UI for Blazor
Type: Feature Request
1
Add support for Size parameter in ContextMenu component

In the Appearance section of the ContextMenu component documentation on the Progress Design System Kit website (https://www.telerik.com/design-system/docs/components/contextmenu/#size), it is stated that:

The ContextMenu provides the size configuration option that enables you to control how big or small the rendered submenu items in the popup will be.

I’ve observed that this functionality is implemented in at least one library—Kendo UI for Angular (https://www.telerik.com/kendo-angular-ui/components/menus/contextmenu/appearance#size).

Is there a plan to introduce support for the Size parameter in the ContextMenu component of the Telerik UI for Blazor library?

1 comment
ADMIN
Dimo
Posted on: 24 Apr 2025 06:35

Hi Anislav,

Currently we have a Size parameter mainly for the textbox and dropdown components, as well as the Button and the Grid. The idea is to ultimately have a Size for all components, but this will likely happen gradually.

Here is how to change the "size" of all Context Menus on the page with CSS.

<div class="context-menu-target" style="width: 200px; height: 100px; background: #fc9;">
    Show large Context Menu.
</div>

<TelerikContextMenu Data="@MenuItems"
                    Selector=".context-menu-target" />

<style>
    .k-animation-container .k-menu-group-md .k-menu-item {
        font-size: var(--kendo-font-size-lg); /* default is --kendo-font-size */
    }

    .k-animation-container .k-menu-group-md .k-menu-link {
        padding-block: var(--kendo-spacing-2); /* default is --kendo-spacing-1 */
        padding-inline: var(--kendo-spacing-4); /* default is --kendo-spacing-2 */
    }

    .k-animation-container .k-menu-group-md .k-menu-expand-arrow {
        margin-inline-end: 0;
    }
</style>

@code {
    private List<ContextMenuItem> MenuItems { get; set; } = new();

    protected override void OnInitialized()
    {
        for (int i = 1; i <= 5; i++)
        {
            MenuItems.Add(new ContextMenuItem()
            {
                Text = $"Menu Item {i}",
                Icon = SvgIcon.Copy,
                Items = new List<ContextMenuItem>() {
                     new ContextMenuItem()
                     {
                         Text = "Child Menu Item",
                         Icon = SvgIcon.Crop
                     }
                 }
            });
        }
    }

    public class ContextMenuItem
    {
        public string Text { get; set; } = string.Empty;
        public object? Icon { get; set; }
        public bool Separator { get; set; }
        public List<ContextMenuItem>? Items { get; set; }
    }
}

 

Regards,
Dimo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.