feat(igx-templates): add side-nav-mini template (collapsible mini navigation)#1716
Open
ivanvpetrov wants to merge 1 commit into
Open
feat(igx-templates): add side-nav-mini template (collapsible mini navigation)#1716ivanvpetrov wants to merge 1 commit into
ivanvpetrov wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Ignite UI for Angular project template (side-nav-mini) that extends the existing side-nav layout with a pinned navigation drawer that can collapse to a mini (icons-only) variant, plus supporting routes/config/styles.
Changes:
- Introduces
SideNavMiniProjecttemplate extending the existingSideNavProject. - Adds a standalone Angular app shell (navbar + pinned nav drawer with full/mini templates) with responsive collapse behavior.
- Adds template-specific routing (including
iconroute metadata), providers, styles, and a basic app creation spec.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/igx-templates/igx-ts/projects/side-nav-mini/index.ts | Registers the new side-nav-mini template by extending the existing side-nav template. |
| packages/igx-templates/igx-ts/projects/side-nav-mini/files/src/app/app.ts | Implements the app shell logic (drawer toggle + resize handling) and builds nav links from route metadata. |
| packages/igx-templates/igx-ts/projects/side-nav-mini/files/src/app/app.html | Defines the navbar and nav drawer full/mini templates with route-driven items. |
| packages/igx-templates/igx-ts/projects/side-nav-mini/files/src/app/app.scss | Styles the fixed navbar + row layout and adjusts behavior at the 1024px breakpoint. |
| packages/igx-templates/igx-ts/projects/side-nav-mini/files/src/app/app.config.ts | Provides Angular + Ignite UI providers/modules needed by the template. |
| packages/igx-templates/igx-ts/projects/side-nav-mini/files/src/app/app.routes.ts | Defines base routes and adds icon metadata for navigation rendering. |
| packages/igx-templates/igx-ts/projects/side-nav-mini/files/src/app/app.spec.ts | Adds a basic “should create app” unit test for the template. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+60
to
+69
| public ngOnInit(): void { | ||
| this.router.events.pipe( | ||
| filter((x): x is NavigationStart => x instanceof NavigationStart) | ||
| ).subscribe(() => { | ||
| // On small screens the nav stays in mini mode — nothing to close | ||
| if (window.innerWidth <= MINI_BREAKPOINT) { | ||
| return; | ||
| } | ||
| }); | ||
| } |
| @@ -0,0 +1,30 @@ | |||
| <igx-navbar class="app-navbar" title="<%=name%>"> | |||
| <igx-navbar-action> | |||
| <button igxIconButton="flat" class="nav-toggle-btn" (click)="toggleNav()"> | |||
Comment on lines
+21
to
+23
| <span igxDrawerItem igxRipple routerLinkActive="igx-nav-drawer__item--active" [routerLink]="link.path"> | ||
| <igx-icon fontSet="material">{{link.icon}}</igx-icon> | ||
| </span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a new Angular project template option to the
ig newwizard: Side navigation + collapsible mini nav.The template is similar to the existing
side-navbut the navigation drawer can collapse to a compact icons-only (mini) variant instead of disappearing completely. The top navbar is always full-width and fixed at the top of the screen.Behavior
[pin]="true",[pinThreshold]="0"), so the mini nav occupies inline layout space and is never an overlay.Changes
packages/igx-templates/igx-ts/projects/side-nav-mini/index.ts— template class extendingSideNavProject, auto-discovered via folder namefiles/src/app/app.ts— importsIgxNavDrawerMiniTemplateDirective,IgxIconComponent,IgxIconButtonDirective,IgxNavbarActionDirective; handles responsive collapse via@HostListener('window:resize')files/src/app/app.html— navbar above the row layout (full-width fixed top);igxDrawertemplate with icon + label;igxDrawerMinitemplate with icon only;[pinThreshold]="0"to prevent auto-pin overridefiles/src/app/app.scss—app-rootas column flexbox,.row-layoutas row flexbox,.view-containerwithoverflow: auto; burger hidden on small screens via@mediafiles/src/app/app.config.ts— providers forIgxNavigationDrawerModule,IgxNavbarModule,IgxIconModule,IgxRippleModulefiles/src/app/app.routes.ts— overrides base routes to addicon: 'home'to the Home route; new views added viaig addfall back toradio_button_uncheckedHow to test
Build the CLI, then generate a new project using the new template: