{
  "id": "5ec1ddf6b142c638622ce133",
  "source": "solid:signals",
  "type": "github-document",
  "title": "router",
  "content": "---\ntitle: Router\nuse_cases: \u003e-\n  app initialization, root setup, layout wrapper, routing context, main\n  configuration\ntags:\n  - component\n  - root\n  - initialization\n  - layout\n  - configuration\n  - context\nversion: '1.0'\ndescription: \u003e-\n  Router is the top-level component that manages your app's routing, providing\n  context and configuration for all child routes and navigation.\n---\n\nThe `Router` component is a top level component that manages the routing of your application.\nThere is an optional `root` prop that can be used to wrap the entire application in a layout component, which will not be updated when the page changes.\n\n```tsx\nimport { render } from \"solid-js/web\";\nimport { Router, Route } from \"@solidjs/router\";\n\nconst App = (props) =\u003e (\n\t\u003c\u003e\n\t\t\u003ch1\u003eRoot header\u003c/h1\u003e\n\t\t{props.children}\n\t\u003c/\u003e\n);\n\nrender(\n\t() =\u003e \u003cRouter root={App}\u003e{/*... routes */}\u003c/Router\u003e,\n\tdocument.getElementById(\"root\")\n);\n```\n\n| prop          | type                                                     | description                                                                                                                                                                               |\n| ------------- | -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| children      | `JSX.Element`, `RouteDefinition`, or `RouteDefinition[]` | The route definitions                                                                                                                                                                     |\n| root          | Component                                                | Top level layout component                                                                                                                                                                |\n| base          | string                                                   | Base url to use for matching routes                                                                                                                                                       |\n| actionBase    | string                                                   | Root url for server actions, default: `/_server`                                                                                                                                          |\n| preload       | boolean                                                  | Enables/disables preloads globally, default: `true`                                                                                                                                       |\n| explicitLinks | boolean                                                  | Disables all anchors being intercepted and instead requires `\u003cA\u003e`. default: `false`. (To disable interception for a specific link, set `target` to any value, e.g. `\u003ca target=\"_self\"\u003e`.) |\n| url           | string                                                   | The initial route to render                                                                                                                                                               |",
  "url": "https://github.com/solidjs/solid-docs/blob/HEAD/src/routes/solid-router/reference/components/router.mdx",
  "metadata": {
    "path": "src/routes/solid-router/reference/components/router.mdx",
    "repo": "solidjs/solid-docs",
    "repo_url": "https://github.com/solidjs/solid-docs.git",
    "size": 3301,
    "source_type": "github"
  },
  "hash": "47bbafb87e5c4dee31982a5152635d4d3d99d849f782d6d4636330a847413042",
  "timestamp": "2026-02-23T11:43:00.192519278+01:00"
}