Site header
Shared public-site header with brand, primary navigation and action slots.
Try it
Public header
Brand and primary nav.
Use it
Working invocation
This code creates the configuration shown above. Copy the template and the required Python context together.
{% extends "brickwork/components/_site_header.html" %}
{% block brand_wordmark %}<a href="/">Brickwork</a>{% endblock %}
{% block site_nav %}<a href="/components/">Components</a>{% endblock %}
context = {'site_header_attrs': '', 'site_header_modifiers': ''}
Guide
Add it to your project
- Extend the template to fill brand and navigation blocks.
- Use `site_nav_region` or `site_actions_region` only when replacing their outer wrappers.
Options
Public API
| Option | Type | Default | Required | Description |
|---|---|---|---|---|
| site_header_modifiers | string | Empty string | No | Consumer classes on the header. Constraint: No additional package-level validation is documented beyond this option's stated type and its role in the component. |
| site_header_attrs | string | Empty string | No | Extra attributes including leading space. Constraint: No additional package-level validation is documented beyond this option's stated type and its role in the component. |
Named blocks
Fill these only when you extend the component template. They are not values passed to an include or tag.
| Block | What it replaces |
|---|---|
| brand_logo | Brand mark inside the package-owned logo wrapper. Constraint: Markup-only extension seam; passing a context variable with this name is ignored. |
| brand_wordmark | Text or wordmark inside the package-owned wordmark wrapper. Constraint: Markup-only extension seam; passing a context variable with this name is ignored. |
| site_nav_region | Outer primary-navigation region replacement seam. Constraint: Markup-only extension seam; passing a context variable with this name is ignored. |
| site_nav | Primary public navigation content. Constraint: Markup-only extension seam; passing a context variable with this name is ignored. |
| site_actions_region | Outer header action-region replacement seam. Constraint: Markup-only extension seam; passing a context variable with this name is ignored. |
| site_actions | Header-end actions or CTA cluster. Constraint: Markup-only extension seam; passing a context variable with this name is ignored. |
Behaviour
Accessibility and responsive behaviour
- Accessibility
- Provides header and labelled primary-nav landmarks.
- Responsive
- Flex-wraps the brand row.
- Without JavaScript
- Static header.
Need help?
Troubleshooting
Contract check: Django {% include %} cannot expose named blocks to a parent that extends
Extend the header to fill brand, navigation, and action seams; an include cannot supply those named blocks to its parent.