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

Documentation

Empty state

A purposeful no-data or no-results state with optional recovery action.

All components Component Brickwork 4.3.1

Try it

No matching results

Open full-page preview

A filter recovery state.

No matching projects

Try removing a filter or changing your search.

Clear filters
Use when a page, panel, or chart has no records to show after a successful load.

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

{% include "brickwork/components/_empty_state.html" with heading=heading body=body variant=variant action_href="/projects/" action_label=action_label %}

your_app/views.py

Python

context = {'heading': 'No matching projects', 'body': 'Try removing a filter or changing your search.', 'variant': 'no_results', 'action_label': 'Clear filters'}

Guide

Add it to your project

  1. Supply body at every size and heading at the default size.
  2. Choose `no_data` for first-use onboarding or `no_results` for an empty filter result.
  3. Include simple copy or extend named regions for rich content.

View this component's source for the installed release

Options

Public API

Option Type Default Required Description
heading str Not set Yes State heading; optional only at size sm. Constraint: No additional package-level validation is documented beyond this option's stated type and its role in the component.
body str Not set Yes Explanation; required at all sizes. Constraint: No additional package-level validation is documented beyond this option's stated type and its role in the component.
variant str no_data No Empty-state intent. Allowed: no_data, no_results. Constraint: Use one of the documented variants; use `danger`, not an invented `error` severity.
icon str Not set No Registered decorative icon. Constraint: No additional package-level validation is documented beyond this option's stated type and its role in the component.
action_href str Not set No Recovery action URL. Constraint: Provide this only with its matching action label and a valid destination.
action_label str Not set No Recovery action text. Constraint: Provide this only with its matching action URL and make the result clear.
size str md No Panel scale. Allowed: sm, md. Constraint: Use one of the documented size choices; unsupported values are not a responsive substitute.
surface str framed No Frame treatment. Allowed: framed, plain. Constraint: Use one of the documented surface choices; do not set a consumer CSS class as a substitute.

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
icon Custom icon region. Constraint: Markup-only extension seam; passing a context variable with this name is ignored.
heading Custom heading region. Constraint: Markup-only extension seam; passing a context variable with this name is ignored.
body Custom body region. Constraint: Markup-only extension seam; passing a context variable with this name is ignored.
action Custom action region. Constraint: Markup-only extension seam; passing a context variable with this name is ignored.

Behaviour

Accessibility and responsive behaviour

Accessibility
Text conveys the outcome and icons are decorative. The md heading is h2 while small embedded states use a paragraph.
Responsive
No breakpoint switch; sm is an explicit embedded-panel scale.
Without JavaScript
Static recovery link works without JavaScript.

Need help?

Troubleshooting

Contract check: Required context: heading (except at size="sm", see below), body (required at

Supply both heading and body at the normal scale; the compact `sm` form is the documented exception for the heading.

Explore next

Used in examples

Documentation