{"id":19174667,"url":"https://github.com/vojvodicn23/ngx-universal-navbar","last_synced_at":"2026-05-18T14:33:32.242Z","repository":{"id":223356715,"uuid":"759888691","full_name":"vojvodicn23/ngx-universal-navbar","owner":"vojvodicn23","description":"This is universal navbar component for Angular","archived":false,"fork":false,"pushed_at":"2024-02-21T15:08:50.000Z","size":217,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-11T00:55:18.752Z","etag":null,"topics":["angular","menubar","navbar","navigation","routing","siderbar"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vojvodicn23.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-19T14:28:24.000Z","updated_at":"2024-03-01T14:18:38.000Z","dependencies_parsed_at":"2025-01-04T01:36:18.450Z","dependency_job_id":"3487fe1e-81ae-4364-bf9f-afcf96403202","html_url":"https://github.com/vojvodicn23/ngx-universal-navbar","commit_stats":null,"previous_names":["vojvodicn23/angularuniversalnavbar","vojvodicn23/angular-universal-navbar"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vojvodicn23%2Fngx-universal-navbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vojvodicn23%2Fngx-universal-navbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vojvodicn23%2Fngx-universal-navbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vojvodicn23%2Fngx-universal-navbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vojvodicn23","download_url":"https://codeload.github.com/vojvodicn23/ngx-universal-navbar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240254182,"owners_count":19772386,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","menubar","navbar","navigation","routing","siderbar"],"created_at":"2024-11-09T10:18:44.262Z","updated_at":"2026-05-18T14:33:27.221Z","avatar_url":"https://github.com/vojvodicn23.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Angular Universal Navbar\n\nSuported Angular versions: 17.\n\n![example](example.png)\n\n[Click here to try it on StackBlitz](https://stackblitz.com/edit/stackblitz-starters-f3b24p)\n\n\n## Usage\nAdd the package as a dependency to your project using:\n\n```\nnpm install angular-universal-navbar\n\n```\n\nAdd module to you app.module imports:\n\n```typescript\nimport { AngularUniversalNavbarComponent, NavItem } from 'angular-universal-navbar';\n...\n@Component({\n  selector: 'app-root',\n  standalone: true,\n  imports: [AngularUniversalNavbarComponent],\n  ...\n})\n```\n\nDefine navbar items in the component(OPTIONAL) If you do not define the navbar items the navbar will not be shown:\n\n```typescript\n\nnavItems = [\n  {\n    name: 'First',\n    route: 'first',\n    styles: {\n      marginLeft: 'auto'\n    },\n  },\n  {\n    name: 'Second',\n    children: [\n      {\n        name: 'Second First',\n        route: 'second-first'\n      },\n      {\n        name: 'Second Second',\n        route: 'second-second'\n      },\n    ],\n  },\n  {\n    name: 'Fifth',\n    styles: {\n      marginRight: 'auto'\n    },\n    classes: [\n      'your-custom-class'\n    ],\n  },\n  {\n    component: SettingsComponent,\n  },\n  {\n    component: UserComponent,\n    componentData: {\n      user: 'NV'\n    }\n  },\n];\n\n```\n\nIn the component template add selector and pass the navbar items.\nAlso, inside selector add router-outlet or any app content you wish.\n\n```html\n\n\u003cangular-universal-navbar\n    [navItems]=\"navItems\"\n\u003e\n    \u003crouter-outlet\u003e\u003c/router-outlet\u003e\n\u003c/angular-universal-navbar\u003e\n\n```\nDefine sidebar items in the component(OPTIONAL) If you do not define the sidebar items the sidebar will not be shown:\n\n```typescript\n\nsideItems: NavItem[] = [\n  {\n    component: LogoComponent,\n    styles: {\n      marginTop: '5px',\n      marginBottom: '50px'\n    },\n  },\n  {\n    name: 'Sidebar first',\n    route: 'first',\n  },\n  {\n    name: 'Sidebar third',\n    route: 'third'\n  },\n  {\n    name: 'Sidebar fourth',\n    route: 'fourth'\n  },\n  {\n    name: 'Sidebar fifth',\n  },\n];\n\n```\n\nIn the component template add selector and pass the sidebar items.\nAlso, inside selector add router-outlet or any app content you wish.\n\n```html\n\n\u003cangular-universal-navbar\n    [sideItems]=\"sideItems\"\n\u003e\n    \u003crouter-outlet\u003e\u003c/router-outlet\u003e\n\u003c/angular-universal-navbar\u003e\n\n```\n\nNavitem is defined as follows. \n\n```typescript\n\nexport interface NavItem {\n    name?: string;\n    route?: string;\n    children?: NavItem[]; \n    component?: Type\u003cany\u003e;\n    componentData?: any;\n    styles?: {[key: string]: string};\n    classes?: string[];\n}\n\n```\n\nThere are three possible options: \n\n1.  Define only name and route which will result as default navbar item as a text field:\n```typescript\n    {\n      name: 'Third',\n      route: 'third'\n    },\n```\n\n2.  Define name and its children and it will result as dropdown:\n```typescript\n    {\n      name: 'Second',\n      children: [\n        {\n          name: 'Second First',\n          route: 'second-first'\n        },\n        {\n          name: 'Second Second',\n          route: 'second-second'\n        },\n      ],\n    },\n```\n\n3.  Create custom component and render it inside navbar.\n```typescript\n    {\n      component: UserComponent,\n      componentData: {\n        user: 'NV'\n      }\n    },\n```\nYou are able to pass data to custom component, shown above which is equivalent to this: \n```html\n\n\u003capp-user\n    user=\"NV\"\n/\u003e\n```\n\n\nFor all options, you are able to pass custom classes and styles:\n```typescript\n    {\n      name: 'Fifth',\n      styles: {\n        marginRight: 'auto'\n      },\n      classes: [\n        'your-custom-class'\n      ],\n    },\n```\n\nYou can change styles directly in your global styles file (styles.css or styles.scss).\n\n```css\n.universal-navbar .active, .universal-sidebar .active{\n    color: black !important;\n    background-color: rgb(234, 233, 233)  !important;\n}\n\n.your-custom-class{\n    background-color: burlywood;\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvojvodicn23%2Fngx-universal-navbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvojvodicn23%2Fngx-universal-navbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvojvodicn23%2Fngx-universal-navbar/lists"}