Skip to main content
brickwork
GitHub Log in Get started
Display
Theme
Density
Direction
Brand

Documentation

Site header

Shared public-site header with brand, primary navigation and action slots.

All components Component Brickwork 4.3.1

Try it

Public header

Open full-page preview

Brand and primary nav.

Use on non-marketing public surfaces needing the common public chrome.

Use it

Working invocation

This code creates the configuration shown above. Copy the template and the required Python context together.

templates/your_app/component.html

Django template

{% extends "brickwork/components/_site_header.html" %}
{% block brand_wordmark %}<a href="/">Brickwork</a>{% endblock %}
{% block site_nav %}<a href="/components/">Components</a>{% endblock %}

your_app/views.py

Python

context = {'site_header_attrs': '', 'site_header_modifiers': ''}

Guide

Add it to your project

  1. Extend the template to fill brand and navigation blocks.
  2. Use `site_nav_region` or `site_actions_region` only when replacing their outer wrappers.

View this component's source for the installed release

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_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.

Documentation