{"id":21716692,"url":"https://github.com/postor/next-navigation","last_synced_at":"2026-04-11T23:31:43.760Z","repository":{"id":230266480,"uuid":"94969884","full_name":"postor/next-navigation","owner":"postor","description":"navigation component for next.js","archived":false,"fork":false,"pushed_at":"2018-01-05T06:34:08.000Z","size":6,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-04T03:42:41.411Z","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/postor.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}},"created_at":"2017-06-21T06:18:46.000Z","updated_at":"2024-09-30T22:02:51.000Z","dependencies_parsed_at":"2024-03-28T19:17:30.900Z","dependency_job_id":"53e42565-b1e9-4fe4-a2fa-2d35c19ea269","html_url":"https://github.com/postor/next-navigation","commit_stats":null,"previous_names":["postor/next-navigation","nextjs-boilerplate/next-navigation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/postor/next-navigation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postor%2Fnext-navigation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postor%2Fnext-navigation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postor%2Fnext-navigation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postor%2Fnext-navigation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/postor","download_url":"https://codeload.github.com/postor/next-navigation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postor%2Fnext-navigation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31585531,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-26T01:12:47.341Z","updated_at":"2026-04-11T23:31:43.745Z","avatar_url":"https://github.com/postor.png","language":"JavaScript","readme":"# next-navigation\n\nnavigation for next, auto highlight menu item of current route\n\n## usage \n\nroutes.js, use next-routes for both server side and client side route\n\n``` \nconst nextRoutes = require('next-routes')\nconst routes = module.exports = nextRoutes()\n\nroutes.add('index', '/')\nroutes.add('login', '/login')\nroutes.add('about', '/about')\nroutes.add('posts', '/posts')\nroutes.add('post', '/p/:title')\n```\n\nHeader.js use nav in your page\n\n```\nimport { default as routes, Link } from './routes'\nimport getNavigation from 'next-navigation'\n\nconst MyNav = getNavigation(routes)\n\nexport default (props)=\u003e{\n\n  var { url } = props\n  var links = [{\n    linkProps: { route: \"index\" },\n    children: \u003ca style={linkStyle}\u003eHome\u003c/a\u003e,\n  }, {\n    linkProps: { route: \"about\" },\n    children: \u003ca style={linkStyle}\u003eAbout\u003c/a\u003e,\n    activeStyle: { color: 'blue', },\n  }, {\n    linkProps: { route: \"posts\" },\n    children: \u003ca style={linkStyle}\u003ePosts\u003c/a\u003e,\n    checkIsActive: ({ pathname }) =\u003e {\n      return ('/post' === pathname) || ('/posts' === pathname)\n    }\n  }]\n\n  const activeStyle = {\n    color: 'red',\n    backgroundColor: '#ddd',\n  }\n\n  {\n    ulProps: {\n      className: 'mynav',\n    },\n    links,\n    activeStyle,\n    activeClassName: 'on',\n    url,\n  }\n  \n  return (\u003cdiv className=\"nav-wrap\"\u003e\n    \u003cMyNav {...navProps} /\u003e\n    \u003cstyle jsx\u003e{`\n        .nav-wrap :global(.mynav) {\n          border: 1px solid black;\n        }\n\n        .nav-wrap :global(.mynav .on a) {\n          font-weight: bold;\n        }\n      `}\u003c/style\u003e\n  \u003c/div\u003e)\n}\n\n```\n\n## full code example\n\nhttps://github.com/nextjs-boilerplate/nextjs-boilerplate\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostor%2Fnext-navigation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpostor%2Fnext-navigation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostor%2Fnext-navigation/lists"}