Hide Drawer item

1 Answer 464 Views
Drawer
Panos
Top achievements
Rank 1
Panos asked on 20 Feb 2022, 08:11 PM
How can hide drawer item?

1 Answer, 1 is accepted

Sort by
0
Preslava
Telerik team
answered on 22 Feb 2022, 09:04 AM

Hi Panos,

The Drawer component provides the option to set custom classes and styles to its items. This can be used to hide an item. To do that the cssClass or cssStyle properties can be used.

Here is an example on how to achieve that:

public items: Array<DrawerItem> = [
        { text: 'Inbox', icon: 'k-i-inbox', selected: true },
        { text: 'Notifications', icon: 'k-i-bell', cssClass: 'custom-item-class' },
        { text: 'Calendar', icon: 'k-i-calendar' }
 ];

.custom-item-class {
      display: none;
}

The following demo represents this approach:

https://stackblitz.com/edit/angular-89akpm-ft85qd?file=app/app.component.ts 

I hope this helps. Let me know should there be further questions.

Regards,
Preslava
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Drawer
Asked by
Panos
Top achievements
Rank 1
Answers by
Preslava
Telerik team
Share this question
or