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

Documentation

Scorecard

A responsive dashboard grid for pre-rendered cards.

All components Component Brickwork 4.3.1

Try it

KPI grid

Open full-page preview

Two pre-rendered tiles.

<article class="bw-stat">Revenue</article>
<article class="bw-stat">Orders</article>
Use to arrange stat or chart-card markup without adding dashboard semantics.

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/_scorecard.html" with items=cards %}

your_app/views.py

Python

context = {'cards': [{'content': '<article class="bw-stat">Revenue</article>', 'span': 2}, {'content': '<article class="bw-stat">Orders</article>'}]}

Guide

Add it to your project

  1. Render each card in the view or template as safe markup.
  2. Pass it as each item’s `content`; optionally give it span 2, 3 or 4.

View this component's source for the installed release

Options

Public API

Option Type Default Required Description
items list of mappings Not set Yes Each item has safe `content` and optional `span`. Constraint: Each item must follow the component's documented item-record shape; keep labels and destinations paired.
data mapping Not set No Consumer-owned data-* attributes. Constraint: Use the component's documented structured data shape; it is not a scalar visitor control.

Behaviour

Accessibility and responsive behaviour

Accessibility
It is a layout grouping; cards own their own accessible semantics.
Responsive
Columns step 1→2→4 at package breakpoints.
Without JavaScript
Grid is server-rendered.

Need help?

Troubleshooting

Contract check: items: a non-empty list of mappings, each: {content: pre-rendered safe

Supply a non-empty list of mappings with trusted pre-rendered `content`; do not pass unescaped user input into that content slot.

Explore next

Used in examples

Documentation