--- title: 'Views' description: 'Nuxt provides several component layers to implement the user interface of your application.' navigation.icon: i-ph-layout --- ## `app.vue` ![The app.vue file is the entry point of your application](/assets/docs/getting-started/views/app.svg) By default, Nuxt will treat this file as the **entrypoint** and render its content for every route of the application. ```vue [app.vue] ``` ::tip If you are familiar with Vue, you might wonder where `main.js` is (the file that normally creates a Vue app). Nuxt does this behind the scene. :: ## Components ![Components are reusable pieces of UI](/assets/docs/getting-started/views/components.svg) Most components are reusable pieces of the user interface, like buttons and menus. In Nuxt, you can create these components in the [`components/`](/docs/guide/directory-structure/components) directory, and they will be automatically available across your application without having to explicitly import them. ::code-group ```vue [app.vue] ``` ```vue [components/AppAlert.vue] ``` :: ## Pages ![Pages are views tied to a specific route](/assets/docs/getting-started/views/pages.svg) Pages represent views for each specific route pattern. Every file in the [`pages/`](/docs/guide/directory-structure/pages) directory represents a different route displaying its content. To use pages, create `pages/index.vue` file and add `` component to the [`app.vue`](/docs/guide/directory-structure/app) (or remove `app.vue` for default entry). You can now create more pages and their corresponding routes by adding new files in the [`pages/`](/docs/guide/directory-structure/pages) directory. ::code-group ```vue [pages/index.vue] ``` ```vue [pages/about.vue] ``` :: :read-more{title="Routing Section" to="/docs/getting-started/routing"} ## Layouts ![Layouts are wrapper around pages](/assets/docs/getting-started/views/layouts.svg) Layouts are wrappers around pages that contain a common User Interface for several pages, such as a header and footer display. Layouts are Vue files using `` components to display the **page** content. The `layouts/default.vue` file will be used by default. Custom layouts can be set as part of your page metadata. ::note If you only have a single layout in your application, we recommend using [`app.vue`](/docs/guide/directory-structure/app) with [``](/docs/api/components/nuxt-page) instead. :: ::code-group ```vue [app.vue] ``` ```vue [layouts/default.vue] ``` ```vue [pages/index.vue] ``` ```vue [pages/about.vue] ``` :: If you want to create more layouts and learn how to use them in your pages, find more information in the [Layouts section](/docs/guide/directory-structure/layouts). ## Advanced: Extending the HTML template ::note If you only need to modify the ``, you can refer to the [SEO and meta section](/docs/getting-started/seo-meta). :: You can have full control over the HTML template by adding a Nitro plugin that registers a hook. The callback function of the `render:html` hook allows you to mutate the HTML before it is sent to the client. ```ts twoslash [server/plugins/extend-html.ts] export default defineNitroPlugin((nitroApp) => { nitroApp.hooks.hook('render:html', (html, { event }) => { // This will be an object representation of the html template. console.log(html) html.head.push(``) }) // You can also intercept the response here. nitroApp.hooks.hook('render:response', (response, { event }) => { console.log(response) }) }) ``` :read-more{to="/docs/guide/going-further/hooks"}