--- title: "" description: The component is required to display pages located in the pages/ directory. links: - label: Source icon: i-simple-icons-github to: https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/pages/runtime/page.ts size: xs --- `` is a built-in component that comes with Nuxt. It lets you display top-level or nested pages located in the [`pages/`](/docs/guide/directory-structure/pages) directory. ::note `` is a wrapper around [``](https://router.vuejs.org/api/interfaces/RouterViewProps.html#interface-routerviewprops) from Vue Router. It should be used instead of `` because the former takes additional care of internal states. Otherwise, `useRoute()` may return incorrect paths. :: `` includes the following components: ```vue ``` By default, Nuxt does not enable `` and ``. You can enable them in the nuxt.config file or by setting the `transition` and `keepalive` properties on ``. If you want to define a specific page, you can set it in `definePageMeta` in the page component. ::warning If you enable `` in your page component, ensure that the page has a single root element. :: ## Props - `name`: tells `` to render the component with the corresponding name in the matched route record's components option. - type: `string` - `route`: route location that has all of its components resolved. - type: `RouteLocationNormalized` - `pageKey`: control when the `NuxtPage` component is re-rendered. - type: `string` or `function` - `transition`: define global transitions for all pages rendered with the `NuxtPage` component. - type: `boolean` or [`TransitionProps`](https://vuejs.org/api/built-in-components#transition) - `keepalive`: control state preservation of pages rendered with the `NuxtPage` component. - type: `boolean` or [`KeepAliveProps`](https://vuejs.org/api/built-in-components#keepalive) ::tip Nuxt automatically resolves the `name` and `route` by scanning and rendering all Vue component files found in the `/pages` directory. :: ## Example For example, if you pass a key that never changes, the `` component will be rendered only once - when it is first mounted. ```vue [app.vue] ``` You can also use a dynamic key based on the current route: ```html ``` ::warning Don't use `$route` object here as it can cause problems with how `` renders pages with ``. :: Alternatively, `pageKey` can be passed as a `key` value via [`definePageMeta`](/docs/api/utils/define-page-meta) from the ` ``` :link-example{to="/docs/examples/routing/pages"} ## Page's Ref To get the `ref` of a page component, access it through `ref.value.pageRef` ````vue [app.vue] ```` ````vue [my-page.vue] ```` ## Custom Props `` also accepts custom props that you may need to pass further down the hierarchy. For example, in the below example, the value of `foobar` will be passed to the `NuxtPage` component and then to the page components. ```vue [app.vue] ``` We can access the `foobar` prop in the page component: ```vue [pages/page.vue] ``` :read-more{to="/docs/guide/directory-structure/pages"}