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

Documentation

Trend indicator

A standalone directional metric caption.

All components Component Brickwork 4.3.1

Try it

Falling cost

Open full-page preview

A decrease judged beneficial.

decreased 2.6 days lower, which is better
Use in a cell or scorecard where a full stat tile is unnecessary.

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/_trend_indicator.html" with trend=trend trend_label=trend_label sentiment=sentiment %}

your_app/views.py

Python

context = {'trend': 'down', 'trend_label': '2.6 days lower, which is better', 'sentiment': 'good'}

Guide

Add it to your project

  1. Include it with a direction and visible comparison copy.
  2. Add sentiment only when the consumer can judge the direction as good or bad.

View this component's source for the installed release

Options

Public API

Option Type Default Required Description
trend string Not set Yes Direction; falsy values render nothing. Allowed: up, down, flat. Constraint: Allowed values: `up`, `down`, `flat`.
trend_label string Not set No Visible comparison wording. Constraint: No additional package-level validation is documented beyond this option's stated type and its role in the component.
sentiment string Not set No Optional independent judgement colour. Allowed: good, bad. Constraint: Allowed values: `good`, `bad`.
css_class string Not set No Escaped extra class tokens. Constraint: No additional package-level validation is documented beyond this option's stated type and its role in the component.

Behaviour

Accessibility and responsive behaviour

Accessibility
Decorative glyph always pairs with hidden direction words, so colour never carries the meaning alone.
Responsive
No breakpoint switch.
Without JavaScript
Static text and icon.

Need help?

Troubleshooting

Contract check: unrecognised value is a caller error the template declines to guess at

Use only the documented trend and sentiment literals. This include has no validation layer and deliberately does not guess unknown values.

Explore next

Used in examples

Documentation