<ply-sidenav> is a free layout shell for section navigation: a left rail (<ply-sidenav-nav>) and a scrollable body (<ply-sidenav-body>). On small screens a hamburger toggles the nav; the mobile breadcrumb label follows the active routerLinkActive item.
Project nav items with routerLink / routerLinkActive="!text-blue-600" (the active class is how the shell picks the mobile label). Put page content or a <router-outlet> in the body.
Demo
Body content scrolls independently of the nav rail. Use the links on the left to switch panels.
<!-- Force mobile chrome (e.g. in a 375px preview frame) -->
<ply-sidenav layout="mobile">...</ply-sidenav>
<!-- Force desktop chrome -->
<ply-sidenav layout="desktop">...</ply-sidenav>
<!-- Default: follow the viewport lg breakpoint -->
<ply-sidenav>
<ply-sidenav-nav>
<ply-nav-list>
<button ply-list-item routerLink="overview" routerLinkActive="text-blue-600! dark:text-blue-400!">Overview</button>
<button ply-list-item routerLink="settings" routerLinkActive="text-blue-600! dark:text-blue-400!">Settings</button>
</ply-nav-list>
</ply-sidenav-nav>
<ply-sidenav-body>
<router-outlet></router-outlet>
</ply-sidenav-body>
</ply-sidenav>
TypeScript
import { Component } from '@angular/core';
// Install: npx ply-ui-cli add sidenav
// Paths are relative to aliases.components (default: src/app/components)
import { SidenavBodyComponent } from './sidenav/sidenav-body/sidenav-body.component';
import { SidenavNavComponent } from './sidenav/sidenav-nav/sidenav-nav.component';
import { SidenavComponent } from './sidenav/sidenav.component';
@Component({
selector: 'app-sidenav-example',
imports: [
SidenavBodyComponent,
SidenavComponent,
SidenavNavComponent
],
template: `...`
})
export class SidenavExampleComponent {}Install
npx ply-ui-cli add sidenav
<ply-scroll-nav> for in-page section TOCs on a single long page.Run the following command to add this shell to your project:
npx ply-ui-cli add sidenav
For AI agents
Copy a prompt with the registry name, CLI install, and import — or add the Ply MCP server.
npx -y ply-ui-mcp
Ply provides standalone components. Import the exact elements you want to use into your component.
// Install: npx ply-ui-cli add sidenav
// Paths are relative to aliases.components (default: src/app/components)
import { SidenavBodyComponent } from './sidenav/sidenav-body/sidenav-body.component';
import { SidenavNavComponent } from './sidenav/sidenav-nav/sidenav-nav.component';
import { SidenavComponent } from './sidenav/sidenav.component';
@Component({
selector: 'app-your-component',
imports: [
SidenavBodyComponent,
SidenavComponent,
SidenavNavComponent
],
template: `...`
})
export class YourComponent {} API for sidenav — generated from JSDoc in the library source.
| API | Member | Type | Default | Description |
|---|---|---|---|---|
ply-sidenav | class | string | '' | Extra host classes merged via `cn()`. |
ply-sidenav | color | IconStrokedButtonColor | undefined | undefined | Color for the mobile nav toggle button. |
ply-sidenav | layout | SidenavLayoutMode | 'auto' | Layout chrome mode. `auto` follows the viewport `lg` breakpoint; `mobile` / `desktop` force that chrome (useful for narrow demos). |
ply-sidenav-body | — | — | — | Main content slot for `ply-sidenav` (typically hosts a router outlet). |
ply-sidenav-body | class | string | '' | Extra host classes merged via `cn()`. |
ply-sidenav-nav | — | — | — | Left navigation slot for `ply-sidenav`. |
ply-sidenav-nav | class | string | '' | Extra host classes merged via `cn()`. |
On this page