v4.1.4 - Customizable Heading Level for Dialog & Opening by hash
v4.1.4 - Customizable Heading Level for Dialog & Opening by hash
-
Added the ability to customize the heading level of the cookie consent dialog title and the accordion headings via the
headingandaccordion-headingattribute on the<x-laravel-cookie-guard>component. -
This allows developers to specify the semantic heading tag (e.g.,
h2,h3, etc.) for better accessibility and SEO integration with their application's heading structure. -
Example usage:
<x-laravel-cookie-guard heading="h2" accordion-heading="h5"/>
-
The default heading level is now
h2forheadingandh5foraccordion-heading, if not specified. -
The cookie consent banner can now also be opened by navigating to the
#consent-settingshash in the URL. The banner will open automatically on page load or when the hash changes to#consent-settings.
Example usage:<div> <a href="#consent-settings">Cookies Preferences</a> </div>