fix(nav-drawer, blazor): fixing the IgbNavDrawer icon usage doc#458
fix(nav-drawer, blazor): fixing the IgbNavDrawer icon usage doc#458kdinev wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Blazor documentation for IgbNavDrawer to properly include the required module registrations and to document/illustrate how IgbIcon icons from the material collection should be registered before use.
Changes:
- Expanded the Blazor
AddIgniteUIBlazor(...)registration snippet to includeIgbNavDrawerItemModuleandIgbIconModule. - Added guidance and sample code showing
IgbIcon.RegisterIcon(...)usage for thematerialicon collection across the topic’s Blazor examples. - Adjusted Blazor icon usage in examples to use a single
@reficon element for registration and simplified other icon instances.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private IgbIcon IconRef { get; set; } | ||
|
|
||
| protected override void OnAfterRender(bool firstRender) | ||
| { | ||
| base.OnAfterRender(firstRender); |
| typeof(IgbNavDrawerHeaderItemModule), | ||
| typeof(IgbNavDrawerItemModule), | ||
| typeof(IgbIconModule) |
There was a problem hiding this comment.
The IgbNavDrawerModule should have the item and header included already IIRC;
So only that and the icon should be quite enough:
| typeof(IgbNavDrawerHeaderItemModule), | |
| typeof(IgbNavDrawerItemModule), | |
| typeof(IgbIconModule) | |
| typeof(IgbIconModule), |
|
|
||
| <PlatformBlock for="Blazor"> | ||
|
|
||
| The icons used throughout the examples in this topic come from the `material` collection and have to be registered before the <ApiLink pkg="core" type="Icon" /> component can render them. Registering an icon requires a reference to a single <ApiLink pkg="core" type="Icon" /> element on the page, on which the <ApiLink pkg="core" type="Icon" member="registerIcon" label="RegisterIcon" /> method is called. For more details, see the [Icon](../layouts/icon.mdx) topic. |
There was a problem hiding this comment.
Pretty sure the core is either not relevant for Blazor and/or can become an issue once we start breaking down those packages with Lite in the mix.
I'd also restrain from repeating the methodology and just go with "need to be registered, see topic". Again, due to the mechanism being a byproduct of generation, less than ideal and subject to change for the better :)
//2c
|
|
||
| ```razor | ||
| <IgbNavDrawer @ref="@NavDrawerRef" Open="true" style="position: relative"> | ||
| <IgbNavDrawer Open="true" style="position: relative"> |
There was a problem hiding this comment.
(0.o)
Unrelated, but like.. the position style has no business on this component
| <IgbNavDrawer Open="true" style="position: relative"> | |
| <IgbNavDrawer Open="true"> |
Closes #
Checklist:
preview/beta./page.mdxor../relative/path.mdx(.mdxextension required)IgxSelectComponent,<igx-combo>code blocksfor the names of classes / tags / propertiescode blockscheck-api/mdxnpm commandsllms.descriptionmetadata and runnpm run check:llms-metadata