Skip to content

SparkBar

Tiny bars beside a number: requests per hour today. No axes; the last bar, now, carries the light.

import { SparkBar } from '@sypnia/ui/react'

On this page
  1. Beside a number
  2. When to use it
  3. For everyone
  4. Props

Beside a number

Requests today18,240
Code
import { SparkBar, Stat } from '@sypnia/ui/react';

// Tiny bars beside a number. The last bar is now.
export default function InStat() {
  return <div className="sy-row"><Stat label="Requests today" value="18,240" /><SparkBar label="Requests per hour today" data={[4, 6, 5, 9, 12, 10, 14, 13, 16, 18]} width={120} height={32} /></div>;
}

When to use it

Use it when

  • Inside a Stat or a table cell, to show the shape behind a number.

Do not use it when

  • When the values themselves matter: use a chart with axes.

For everyone

  • It is an image with a name that says what it shows.

Props

SparkBarTypeDefault
datarequired number[]
labelrequired string
height number 28
width number 96
  1. Beside a number
  2. When to use it
  3. For everyone
  4. Props

    Search pages, sections and terms