Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

pc579's avatar
Level 1

How to change <title> with Inertia / Vue3?

On a Laravel / Inertia / Vue project I don't succeed to change the title of my web pages.

I created a test with a new project "laravel new Laravel11b" with the following option and discover that it's the same, for instance in the Dashboard page we have : Laravel and not Dashboard.

Laravel new options used : ┌ Would you like to install a starter kit? ────────────────────┐ │ Laravel Jetstream │ └──────────────────────────────────────────────────────────────┘

┌ Which Jetstream stack would you like to install? ────────────┐ │ Vue with Inertia │ └──────────────────────────────────────────────────────────────┘

┌ Would you like any optional features? ───────────────────────┐ │ Email verification │ │ Inertia SSR │ └──────────────────────────────────────────────────────────────┘

┌ Which testing framework do you prefer? ──────────────────────┐ │ Pest │ └──────────────────────────────────────────────────────────────┘

┌ Would you like to initialize a Git repository? ──────────────┐ │ No

0 likes
6 replies
tykus's avatar

You can add a title in a <Head> component within each Page component of your Inertia app

import { Head } from '@inertiajs/vue3'

<Head title="Dashboard" />

More generally, you can setup the title when you create the Inertia app, e.g. appending the given Page title to a general application title:

createInertiaApp({
  title: title => `${title} - Laravel 11 B`,
  // ...
})

https://inertiajs.com/title-and-meta

pc579's avatar
Level 1

Thank @tykus for your answer.

I saw this in the Inertia doc but it does not work or I don't understand st.

In the example test , fresh laravel installl with jetstream / Inertia / Vue you have :

Dashboard.vue

<template>
    <AppLayout title="Dashboard">

and AppLayout.vue

<template>
    <div>
        <Head :title="title" />

but as I wrote in my initial post the title is not Dashboard in the page...

tykus's avatar

@pc579 I cannot replicate. Have you made any changes to the freshly installed application?

1 like
pc579's avatar
Level 1

@tykus , strange I made no change also.

I cannot replicate means that you see <title inertia>Dashboard</title> ?

I see <title inertia>Laravel</title>

I have to test on an other server ...

tykus's avatar
tykus
Best Answer
Level 104

@pc579 I think I understand what you're looking at now... that title is being set on the resources/views/app.blade.php layout into which the Inertia app will eventually be rendered. Whenever you View Page Source you will see the markup before the Javascript application has been executed. If you check the Elements tab in your browser's devtools, you will see the state after Inertia has rendered the dashboard.

Please or to participate in this conversation.