Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (30 sloc) 1.16 KB

+++ title = "Number" +++

The number widget can be found at src/widgets/number/widget.jsx. Because the number widget is the most commonly used widget, the background colours are randomised to keep the dashboards unique. So don't be surprised if you see them change colour.

Usage

  import NumberWidget from '../widgets/number/widget';
  <NumberWidget
    name="MyCatWidget"
    title="Catz Conversion"
    metric="%"
  />

Props

Prop Description Required
name Name of widget. Used to update the widget when a job completes Yes
title Title of widget. Usually displayed above the metric value Yes
metric Metric to use for value passed to widget e.g. % Optional
format How to format the widget value. See Numeral docs. Optional
size Size of the widget: small (default) or medium can be used Optional

Data Stucture

When building a job for a number widget, a single value should be used e.g.

data: { value: 1.4 };

Example