{"id":13722830,"url":"https://github.com/jikkai/svelte-router","last_synced_at":"2025-05-07T16:31:00.232Z","repository":{"id":57375336,"uuid":"78630642","full_name":"jikkai/svelte-router","owner":"jikkai","description":"Router component for Svelte","archived":true,"fork":false,"pushed_at":"2020-08-07T22:45:51.000Z","size":777,"stargazers_count":62,"open_issues_count":13,"forks_count":10,"subscribers_count":3,"default_branch":"dev","last_synced_at":"2025-05-06T13:07:42.872Z","etag":null,"topics":["router","router-component","svelte"],"latest_commit_sha":null,"homepage":"https://jikkai.github.io/svelte-router","language":"HTML","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/jikkai.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":"2017-01-11T11:01:13.000Z","updated_at":"2024-12-17T09:29:26.000Z","dependencies_parsed_at":"2022-09-07T13:40:12.330Z","dependency_job_id":null,"html_url":"https://github.com/jikkai/svelte-router","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jikkai%2Fsvelte-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jikkai%2Fsvelte-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jikkai%2Fsvelte-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jikkai%2Fsvelte-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jikkai","download_url":"https://codeload.github.com/jikkai/svelte-router/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252915245,"owners_count":21824528,"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":["router","router-component","svelte"],"created_at":"2024-08-03T01:01:33.485Z","updated_at":"2025-05-07T16:30:59.831Z","avatar_url":"https://github.com/jikkai.png","language":"HTML","funding_links":[],"categories":["components and libraries"],"sub_categories":["routers"],"readme":"# Svelte Router\n\n![version](https://img.shields.io/npm/v/svelte-router.svg)\n![license](https://img.shields.io/github/license/mashape/apistatus.svg)\n\n\u003e Router component for Svelte\n\nThis branch is for Svelte v3.0.0+. For usage with Svelte v1.8.0+, see the [v2 branch](https://github.com/jikkai/svelte-router/tree/v2). For usage with Svelte v1.8.0-, see the [0.1.x branch](https://github.com/jikkai/svelte-router/tree/0.1.x).\n\n## Installation\n\nUsing npm:\n\n```bash\nnpm install --save svelte-router\n```\n\nUsing yarn:\n\n```bash\nyarn add svelte-router\n```\n\n## Examples\n\n```html\n\u003cdiv\u003e\n  \u003cLink to=\"/\"\u003eHome\u003c/Link\u003e\n  \u003cLink to=\"/welcome\"\u003eWelcome\u003c/Link\u003e\n  \u003cdiv use:create\u003e\u003c/div\u003e\n\u003c/div\u003e\n\n\u003cscript\u003e\n  import SvelteRouter, { Link } from 'svelte-router'\n  import Home from './Home.svelte'\n  import Welcome from './Welcome.svelte'\n\n  function create (node) {\n    const router = new SvelteRouter({\n      target: node,\n      mode: 'hash',\n      routes: [{\n        path: '/',\n        component: Home\n      }, {\n        path: '/welcome',\n        component: Welcome\n      }]\n    })\n\n    return {\n      destroy () {\n        router.destroy()\n      }\n    }\n  }\n\u003c/script\u003e\n\n\u003cstyle\u003e\n  .router-link-active {\n    color: red;\n  }\n\u003c/style\u003e\n```\n\n## API\n\n### SvelteRouter\n\n* `push(path: string)`\n* `replace(path: string)`\n* `go(n: number)`\n* `goBack()`\n* `goForward()`\n* `listen(fn: function)`\n\n### Link\n\n* `to`: string\n* `replace`: boolean\n* `className`: string\n* `activeClassName`: string\n\n## Contributors\n\n* [@rumpytim](https://github.com/rumpytim)\n* [@RobBrazier](https://github.com/RobBrazier)\n* [@stalkerg](https://github.com/stalkerg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjikkai%2Fsvelte-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjikkai%2Fsvelte-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjikkai%2Fsvelte-router/lists"}