Jump to main content

Work in progress

Vanilla's patterns are newly released and still evolving as we receive feedback.

The data spotlight is a pattern where key statistics serve as the main content, supported by short headlines and optional descriptions.

It is composed of the following elements:

Element Description
Title (required) Main heading text (h2)
Blocks (required) Array of data spotlight blocks

Layout Options

Linked Title

The title can be made clickable by providing link attributes.

Data Spotlight Blocks

You can pass an array of data spotlight block objects to this pattern.

{
  "stat": "text" (required),
  "headline": "text" (optional),
  "description": "text" (optional),
  "link": {
    "url": "link-url",
    "text": "link-text"
  } (optional)
}

Variants

Depending on the number of data spotlight blocks provided, there are 3 variants of this pattern.

4 blocks

3 blocks

2 blocks

Usage Examples

Without description

Without CTA

Without CTA and description

Only statistics

Jinja Macro

The vf_data_spotlight Jinja macro can be used to generate a Data spotlight pattern. The API for the macro is shown below.

Parameters

Name Required? Type Default Description
title Yes Object N/A Title configuration object with text and optional link_attrs
title.text Yes string N/A The main title text (rendered as h2)
title.link_attrs No Object N/A Attributes of an anchor element, as a dictionary. See attribute forwarding docs for more info.
blocks Yes Array<Object> [] Array of blocks to display in the section. See Data Spotlight Blocks for configuration details.

Import

Jinja Macro

To import the Data Spotlight Jinja macro, copy the following import statement into your Jinja template.

{% from "_macros/vf_data-spotlight.jinja" import vf_data_spotlight %}

View the building with Jinja macros guide for macro installation instructions.

SCSS

Since Patterns leverage many other parts of Vanilla in their composition and content, we recommend importing the entirety of Vanilla for full support.