{"id":18623562,"url":"https://github.com/codica2/simple-sidenav","last_synced_at":"2025-04-11T03:31:46.389Z","repository":{"id":57360876,"uuid":"162602482","full_name":"codica2/simple-sidenav","owner":"codica2","description":"Simple, easily customizable, animated menu.","archived":false,"fork":false,"pushed_at":"2019-06-03T08:12:31.000Z","size":2654,"stargazers_count":39,"open_issues_count":1,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T13:53:22.109Z","etag":null,"topics":["angular","menu","navigation","sidenav"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codica2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-20T16:09:49.000Z","updated_at":"2024-08-12T19:44:12.000Z","dependencies_parsed_at":"2022-09-06T22:20:51.446Z","dependency_job_id":null,"html_url":"https://github.com/codica2/simple-sidenav","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codica2%2Fsimple-sidenav","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codica2%2Fsimple-sidenav/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codica2%2Fsimple-sidenav/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codica2%2Fsimple-sidenav/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codica2","download_url":"https://codeload.github.com/codica2/simple-sidenav/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248335474,"owners_count":21086601,"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","menu","navigation","sidenav"],"created_at":"2024-11-07T04:25:02.650Z","updated_at":"2025-04-11T03:31:41.379Z","avatar_url":"https://github.com/codica2.png","language":"TypeScript","readme":"\u003ch1 align=\"center\"\u003eSimple sidenav\u003c/h1\u003e\n\n\n**Simple sidenav** is a simple, easily customizable, animated menu, with the possibility of infinite nesting that was built specifically for Angular apps.\n\n## Demos\n\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"src/assets/gifs/simple-sidenav.gif\"\u003e\n\u003c/p\u003e\n\n## Installation\n\n``` bash\nnpm install simple-sidenav --save\n```\n\n## Usage\n\n**Module**\n\n``` javascript\n# app.module.ts\nimport { BrowserModule } from '@angular/platform-browser';\nimport { NgModule } from '@angular/core';\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\n\nimport { AppRoutingModule } from './app-routing.module';\nimport { AppComponent } from './app.component';\nimport { SimpleSidenavModule } from 'simple-sidenav';\n\n@NgModule({\n  declarations: [\n    AppComponent\n  ],\n  imports: [\n    BrowserModule,\n    AppRoutingModule,\n    SimpleSidenavModule,\n    BrowserAnimationsModule\n  ],\n  bootstrap: [AppComponent]\n})\nexport class AppModule { }\n\n```\n**Component**\n\n``` javascript\n# app.component.ts\nimport { Component } from '@angular/core';\nimport { SimpleMenu } from 'simple-sidenav';\n\n@Component({\n  selector: 'app-root',\n  templateUrl: './app.component.html',\n  styleUrls: ['./app.component.scss']\n})\nexport class AppComponent {\n  menu: SimpleMenu[] = [...];\n  animation: SimpleAnimation = {\n    in: { value: 'slide-in-stagger' },\n    out: { value: 'slide-out', duration: 200 }\n  };\n\n  onClick(item: {id: number|string, name: string, icon: string, index: number}) {\n    ...\n  }\n}\n\n```\n**HTML**\n``` html\n# app.component.html\n\u003csm-simple-sidenav\n  [menu]=\"menu\"\n  [activeID]=\"'2'\"\n  [animation]=\"animation\"\n  [withArrow]=\"true\"\n  (onSidenav)=\"onClick($event)\"\u003e\n\u003c/sm-simple-sidenav\u003e\n```\n\n**[menu] prop example:**\n```json\nmenu: SimpleMenu[] = [\n  { \"id\": \"1\", \"name\": \"Ruby on Rails\", \"icon\": \"assets/images/rails.png\", \"menu\": [\n    { \"id\": \"1\", \"name\": \"Models\", \"menu\": [\n      { \"id\": \"1\", \"name\": \"Active Record Basics\" },\n      { \"id\": \"2\", \"name\": \"Active Record Migrations\" },\n      { \"id\": \"3\", \"name\": \"Active Record Validations\" },\n      { \"id\": \"4\", \"name\": \"Active Record Callbacks\" },\n      { \"id\": \"5\", \"name\": \"Active Record Associations\" },\n      { \"id\": \"6\", \"name\": \"Active Record Query Interface\", \"menu\": [...] }\n    ] },\n    ] },\n  { \"id\": \"2\", \"name\": \"Angular\", \"icon\": \"assets/images/angular.png\", \"menu\": [...] },\n  ...\n]\n```\n\u003e NOTE: `id` must be unique, an `icon` is optional, a `menu` can contain an infinite level of nested menu\n\n**[activeID] prop example:**\n\nIf you want menu to be opened by default at some position just pass an `id` of menu item to [activeID] prop.\n```javascript\n[activeID]=\"'yourMenuItemID'\"\n```\n\n**[animation] prop example:**\n\nWe have two types of animation, **in** and **out**. Value is a name of animation. Duration is an optional parameter that shows how long the animation should work.\n\nFor **in:** we have two animations for choice `slide-in | slide-in-stagger`.\n\nFor **out:** just one `slide-out`.\n```json\n{\n  \"in\": { \"value\": \"slide-in-stagger\" },\n  \"out\": { \"value\": \"slide-out\", \"duration\": \"200\" }\n}\n```\nIf you don’t want any animations - just pass false into ```[animation]=\"false\"```\n\n## API\n\n| Props           | Default value | Interface                   | Description                                                                          | Required |\n| --------------- | ------------- | --------------------------- | ------------------------------------------------------------------------------------ | -------- |\n| `[menu]`        | `none`        | ```SimpleMenu[]```          | See example above.                                                                   | `true` |\n| `[animation]`   | `false`       | ```SimpleAnimation```       | Pass object with animation name. See example above.                                 | `false`|\n| `(onSidenav)`   | `----`        | ```--------```              | Pass callback function to listen for sidenav clicks. `$event` contains an `id` and `index` of the clicked element.|`false`|\n| `[animate]`     | `false`       | ```boolean```               | Set to true if you want to animate the first appearance of the sidenav.                  | `false`|\n| `[withArrow]`   | `true`        | ```boolean```               | Set to false if you want to hide an arrow icon.                                         | `false`|\n| `[activeID]`    | `none`        | ```string```                | Pass an ID of menu item if you want it to be opened by default.                         | `false`|\n\n## License\nSimple sidenav is Copyright © 2015-2018 Codica. It is released under the [MIT License](https://opensource.org/licenses/MIT).\n\n## About Codica\n\n[![Codica logo](https://www.codica.com/assets/images/logo/logo.svg)](https://www.codica.com)\n\nSimple sidenav is maintained and funded by Codica. The names and logos for Codica are trademarks of Codica.\n\nWe love open source software! See [our other projects](https://github.com/codica2) or [hire us](https://www.codica.com/) to design, develop, and grow your product.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodica2%2Fsimple-sidenav","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodica2%2Fsimple-sidenav","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodica2%2Fsimple-sidenav/lists"}