diff --git a/docs/xplat/src/content/en/components/menus/navigation-drawer.mdx b/docs/xplat/src/content/en/components/menus/navigation-drawer.mdx index 188bae1fa8..87b4d2d1b3 100644 --- a/docs/xplat/src/content/en/components/menus/navigation-drawer.mdx +++ b/docs/xplat/src/content/en/components/menus/navigation-drawer.mdx @@ -73,7 +73,9 @@ Before using the , you need to register i builder.Services.AddIgniteUIBlazor( typeof(IgbNavDrawerModule), - typeof(IgbNavDrawerHeaderItemModule) + typeof(IgbNavDrawerHeaderItemModule), + typeof(IgbNavDrawerItemModule), + typeof(IgbIconModule) ); ``` @@ -132,20 +134,36 @@ The simplest way to start using the is a +The icons used throughout the examples in this topic come from the `material` collection and have to be registered before the component can render them. Registering an icon requires a reference to a single element on the page, on which the method is called. For more details, see the [Icon](../layouts/icon.mdx) topic. + ```razor Sample Drawer - + Home - + Search + +@code { + private IgbIcon IconRef { get; set; } + + protected override void OnAfterRender(bool firstRender) + { + base.OnAfterRender(firstRender); + if (this.IconRef != null && firstRender) + { + this.IconRef.RegisterIcon("home", "https://unpkg.com/material-design-icons@3.0.1/action/svg/production/ic_home_24px.svg", "material"); + this.IconRef.RegisterIcon("search", "https://unpkg.com/material-design-icons@3.0.1/action/svg/production/ic_search_24px.svg", "material"); + } + } +} ``` @@ -216,7 +234,7 @@ To enhance our component a bit, we can use it in conjunction with the - +

Home

@@ -229,7 +247,7 @@ To enhance our component a bit, we can use it in conjunction with the Home - + Search @@ -313,6 +331,19 @@ this.radioGroup.addEventListener('click', (radio: any) => { public IgbNavDrawer NavDrawerRef { get; set; } + private IgbIcon IconRef { get; set; } + + protected override void OnAfterRender(bool firstRender) + { + base.OnAfterRender(firstRender); + if (this.IconRef != null && firstRender) + { + this.IconRef.RegisterIcon("menu", "https://unpkg.com/material-design-icons@3.0.1/navigation/svg/production/ic_menu_24px.svg", "material"); + this.IconRef.RegisterIcon("home", "https://unpkg.com/material-design-icons@3.0.1/action/svg/production/ic_home_24px.svg", "material"); + this.IconRef.RegisterIcon("search", "https://unpkg.com/material-design-icons@3.0.1/action/svg/production/ic_search_24px.svg", "material"); + } + } + public void OnRadioOptionClick(IgbComponentBoolValueChangedEventArgs args) { IgbRadio radio = args.Parent as IgbRadio; @@ -466,16 +497,16 @@ With the mini variant, the Navigation Drawer changes its width instead of closin ```razor - + Sample Drawer - + Home - + Search
@@ -487,6 +518,20 @@ With the mini variant, the Navigation Drawer changes its width instead of closin
+ +@code { + private IgbIcon IconRef { get; set; } + + protected override void OnAfterRender(bool firstRender) + { + base.OnAfterRender(firstRender); + if (this.IconRef != null && firstRender) + { + this.IconRef.RegisterIcon("home", "https://unpkg.com/material-design-icons@3.0.1/action/svg/production/ic_home_24px.svg", "material"); + this.IconRef.RegisterIcon("search", "https://unpkg.com/material-design-icons@3.0.1/action/svg/production/ic_search_24px.svg", "material"); + } + } +} ```