{"id":19787227,"url":"https://github.com/logandk/meteor-iron-router-active","last_synced_at":"2025-06-26T03:33:32.188Z","repository":{"id":27720135,"uuid":"31207418","full_name":"logandk/meteor-iron-router-active","owner":"logandk","description":"Meteor template helper for detecting the active iron:router route","archived":false,"fork":false,"pushed_at":"2015-03-05T09:00:54.000Z","size":132,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T14:09:20.487Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/logandk.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}},"created_at":"2015-02-23T12:36:40.000Z","updated_at":"2023-03-05T01:57:13.000Z","dependencies_parsed_at":"2022-09-02T23:00:15.120Z","dependency_job_id":null,"html_url":"https://github.com/logandk/meteor-iron-router-active","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/logandk/meteor-iron-router-active","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logandk%2Fmeteor-iron-router-active","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logandk%2Fmeteor-iron-router-active/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logandk%2Fmeteor-iron-router-active/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logandk%2Fmeteor-iron-router-active/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logandk","download_url":"https://codeload.github.com/logandk/meteor-iron-router-active/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logandk%2Fmeteor-iron-router-active/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261994438,"owners_count":23242004,"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":[],"created_at":"2024-11-12T06:21:49.938Z","updated_at":"2025-06-26T03:33:32.168Z","avatar_url":"https://github.com/logandk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Meteor](https://github.com/meteor/meteor) template helper for detecting the active [iron:router](https://github.com/eventedmind/iron-router) route\n![Code Climate](https://img.shields.io/codeclimate/github/logandk/meteor-iron-router-active.svg)\n\nThis package is based on the excellent [zimme:iron-router-active](https://github.com/zimme/meteor-iron-router-active) package. After adding some features and modifying the original package, it ended up being mostly rewritten. I decided to release this as a separate package for people with similar use cases as myself.\n\nA single template helper is exposed by this package: `isActive`. Check the usage instructions below.\n\n## Install\n```sh\nmeteor add logandk:iron-router-active\n```\n\n## Usage\nInsert the `isActive` helper either inside a class attribute or an `#if` statement. Either a route or path must be specified.\n```handlebars\n{{isActive route='index'}}\n```\n\n## Options\nThe following options may be provided to the `isActive` helper.\n\n### Route/path specifier (mandatory)\n\nOne of the `route`/`path` parameters must be specified. By default, the function will return `active` if there is a match.\n\n```handlebars\n{{isActive route='movies.all'}}\n{{isActive path='/movies/all'}}\n```\n\n### Custom class name\n\nUse the `className` parameter to override the default class name (`active`).\n\n```handlebars\n{{isActive route='movies.all' className='on'}}\n```\n\n### Regular expression matching\n\nSet the `regex` parameter to `true` in order to enable regular expression matching.\n\n```handlebars\n{{isActive route='^movies' regex=true}}\n```\n\n### Inverted matching\n\nSet the `inverse` parameter to `true` in order to invert matching. This change the default to return `disabled` if there is no match. This default can be changed using the `className` parameter.\n\n```handlebars\n{{isActive route='movies' inverse=true}}\n{{isActive route='movies' className='off' inverse=true}}\n```\n\n### Data context\n\nJust like the `pathFor` helper in `iron:router`, a data context can be specified. This will cause any parameters in the route url to be matched against the corresponding attributes of the context object. By default, the current template context is passed, so the first two examples below are identical.\n\n```handlebars\n{{isActive route='movies.show'}}\n{{isActive route='movies.show' data=this}}\n{{isActive route='movies.show' data=movie}}\n```\n\n\n## Example\n```handlebars\n\u003cnav\u003e\n  \u003cul\u003e\n    \u003cli class=\"{{isActive route='dashboard'}}\"\u003e...\u003c/li\u003e\n    \u003cli class=\"{{isActive path='/profile'}}\"\u003e...\u003c/li\u003e\n    \u003cli class=\"{{isActive route='^user' regex=true}}\"\u003e...\u003c/li\u003e\n    {{#each users}}\n      \u003cli class=\"{{isActive route='user.show'}}\"\u003e...\u003c/li\u003e\n    {{/each}}\n    \u003cli class=\"{{isActive route='products' className='on'}}\"\u003e...\u003c/li\u003e\n    {{#if isActive route='index'}}\n      \u003cli\u003e...\u003c/li\u003e\n    {{/if}}\n    \u003cli class=\"{{isActive route='dashboard' inverse=true}}\"\u003e...\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/nav\u003e\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogandk%2Fmeteor-iron-router-active","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogandk%2Fmeteor-iron-router-active","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogandk%2Fmeteor-iron-router-active/lists"}