fractalsvelte mascot fractalsvelte fractalsvelte

Svelte 5 component · machines-ui · Graphs

GraphMeter

Horizontal progress bar that spans the frame: [ = = = - - - ] 42%.

Install

GraphMeter is a Svelte 5 ASCII meter 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 { GraphMeter } from '@fractaldesign/machines-ui';

Usage

Example
<GraphMeter title="SHIPPED" value={0.67} caption="characters, not a progress bar" />

Props

NameTypeDefault
title string Caption drawn on the top edge as `[ TITLE ]`. Uppercase, 1–2 words.—
value number Fraction filled, from 0 to 1.—
ticks number Number of ticks the bar is divided into.14
caption string Optional muted caption shown under the bar.—
glyphs Glyphs Characters that draw the graph: a preset name (`shade`, `ascii`, `hash`, `bar`) or your own array, lightest to heaviest.—
corner string Character drawn at each corner of the frame.—
class string ''