Skip to content

Conversation

@josalzi
Copy link

@josalzi josalzi commented Nov 6, 2025

Good day,

Supporting #1002, I have modified the Header component view file to include an optional use-h1 attribute.
If the attribute is passed to the component, the render will be done using <h1></h1> tags.
This is to support SEO optimization.

Usage: <x-header title="Welcome!" size="text-4xl" subtitle="This is a welcome page" class="!mb-5" use-h1 />

From my test, there is no breaking of existing styling/layout, and you can still override default h1 styling references with custom class attributes.

The html rendering looks correct as well:
<div id="welcome" class="mb-10 !mb-5"><div class="flex flex-wrap gap-5 justify-between items-center"><div><h1 class="flex items-center text-4xl font-extrabold " >Welcome!</h1><div class="text-base-content/50 text-sm mt-1 " >This is a welcome page</div></div><div class="flex items-center gap-3 " > </div></div>

Let me know your thoughts.
Joey

Note: sorry for the bad readability of my PR, I have difficulties with the Markdown editor.

As SEO requires one unique <h1> tag per page to optimize indexing, made the Header component with an optional "use-h1" attribute triggering the render of the header with <h1> tags rather than <div> and <span>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant