Overview
The Header component is a reusable site top bar (logo, navigation, actions, burger, etc.). It ships with a base structure and styling, plus a plugin folder for optional behaviors.
Component location
Header files are located in src/components/layout/header.
Inside you’ll find:
- JS file for component logic (if needed).
- HTML file with base header markup.
- SCSS file for styling the header.
Plugins live in src/components/layout/header/plugins.
Using the component
Connect the header HTML to your page using <include>.
In the starter setup it’s already included by default in shared layout.
<include src="@components/layout/header/header.html"></include>
Plugins
Header plugins are optional behaviors you enable via data attributes. The most common one is the Scroll plugin.
Plugin: Scroll
The Scroll plugin manages header state classes while the page scrolls.
To enable it, add data-anim-header and data-anim-header-scroll
to your <header>.
<header data-anim-header data-anim-header-scroll class="header">
...
</header>
When you scroll more than 1px, the header receives the class
--header-scroll.
Custom scroll threshold
To change how many pixels must be scrolled before activating the class,
set a value for data-anim-header-scroll.
<header data-anim-header data-anim-header-scroll="500" class="header">
...
</header>
Auto-hide header on scroll down
To enable “disappearing” header behavior (hide on scroll down, show after a short pause),
add data-anim-header-scroll-show.
By default, the show delay is 500ms.
<header
data-anim-header
data-anim-header-scroll
data-anim-header-scroll-show
class="header">
...
</header>
To change the delay, set a value (ms) for data-anim-header-scroll-show.
<header
data-anim-header
data-anim-header-scroll
data-anim-header-scroll-show="1000"
class="header">
...
</header>
src/components/layout/header/plugins/scroll/scroll.scss
Download
Build clean headers with optional scroll behavior and a plugin-first structure. Download the template and ship faster.