The header component is used to provide a consistent and recognizable top bar, typically containing a logo and main navigation.
Example
code
<script type="module">
import '@blueprintui/components/include/header.js';
</script>
<bp-header>
<bp-button>header</bp-button>
<bp-button bp-layout="inline:end">item</bp-button>
<bp-button>item</bp-button>
<bp-button><a href="#">link</a></bp-button>
</bp-header>
Install
NPM
import '@blueprintui/components/include/header.js';
CDN
<script type="module">
import 'https://cdn.jsdelivr.net/npm/@blueprintui/components/include/header.js/+esm';
</script>
Accessibility
- The header logo image should have alternative text for screen readers.
- The main navigation should be keyboard accessible, allowing users to navigate through the items using the tab key and activating them with the enter or space key.
Properties
CSS Properties
| Name | Types | Description |
|---|
--padding | | |
--background | | |
--color | | |
--height | | |
--font-size | | |
--gap | | |
Slots
| Name | Types | Description |
|---|
default | | badge content |