fractalsvelte mascot fractalsvelte fractalsvelte

Svelte 5 component · machines-ui · Graphs

GraphStat

A row of two to four large figures with labels, each optionally hinted and accented.

Install

GraphStat is a Svelte 5 ASCII stat chart component in @fractaldesign/machines-ui. It works in SvelteKit and in any Svelte 5 app.

pnpm add @fractaldesign/machines-ui

Import

import
import '@fractaldesign/machines-ui/style.css';
import { GraphStat } from '@fractaldesign/machines-ui';

Usage

Example
<GraphStat
  title="THIS WEEK"
  items={[
    { value: '12,400', label: 'docs' },
    { value: '4,100', label: 'copies' },
    { value: '860', label: 'shipped', accent: true }
  ]}
/>

Props

NameTypeDefault
title string Caption drawn on the top edge as `[ TITLE ]`. Uppercase, 1–2 words.—
items StatItem[] Figures to show left to right; only the first four are laid out.—
corner string Character drawn at each corner of the frame.—
class string ''