BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/moco/spark

Spark

moco/spark
FreeComponent

Server-safe inline SVG sparklines and proportion bars that sit on the text baseline.

Live preview

live · rendered by the registry
Rendered by moco on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://mocoui.site/r/spark.json

Source

registry/spark/spark.tsxmocoui.site/r/spark.json
1import * as React from "react";
2import "./spark.css";
3
4export type SparkTone = "accent" | "warn" | "faint";
5
6const TONE: Record<SparkTone, string> = {
7 accent: "var(--moco-accent-dk)",
8 warn: "var(--moco-warn)",
9 faint: "var(--moco-faint)",
10};
11
12export interface SparkProps {
13 data: number[];
14 w?: number;
15 h?: number;
16 dot?: boolean;
17 tone?: SparkTone;
18 label?: string;
19}
20
21/**
22 * Inline sparklines. ~60×16, sits on the text baseline, no axes, no labels.
23 * These are punctuation, not charts.
24 */
25export function Spark({ data, w = 60, h = 16, dot = true, tone = "accent", label }: SparkProps) {
26 if (data.length < 2) return null;
27 const min = Math.min(...data);
28 const max = Math.max(...data);
29 const span = max - min || 1;
30 const x = (i: number) => (i / (data.length - 1)) * (w - 2) + 1;
31 const y = (v: number) => h - 2 - ((v - min) / span) * (h - 4);
32 const d = data.map((v, i) => `${i ? "L" : "M"}${x(i).toFixed(2)},${y(v).toFixed(2)}`).join(" ");
33
34 return (
35 <svg
36 className="moco-spark"
37 width={w}
38 height={h}
39 viewBox={`0 0 ${w} ${h}`}
40 role="img"
41 aria-label={label ?? `sparkline, ${data.length} points, ${min.toFixed(2)} to ${max.toFixed(2)}`}
42 >
43 <path d={d} fill="none" stroke={TONE[tone]} strokeWidth="1" />
44 {dot ? (
45 <circle
46 cx={x(data.length - 1)}
47 cy={y(data[data.length - 1])}
48 r="1.6"
49 fill={TONE[tone]}
50 />
51 ) : null}
52 </svg>
53 );
54}
55
56export interface SparkBarProps {
57 value: number;
58 max?: number;
59 w?: number;
60 h?: number;
61 tone?: SparkTone;
62 label?: string;
63}
64
65/** A tiny inline proportion bar. */
66export function SparkBar({ value, max = 1, w = 60, h = 8, tone = "accent", label }: SparkBarProps) {
67 const k = Math.max(0, Math.min(1, value / max));
68 return (
69 <svg
70 className="moco-spark"
71 width={w}
72 height={h}
73 viewBox={`0 0 ${w} ${h}`}
74 role="img"
75 aria-label={label ?? `${Math.round(k * 100)} percent`}
76 >
77 <rect x="0" y={h / 2 - 2} width={w} height="4" fill="var(--moco-line)" />
78 <rect x="0" y={h / 2 - 2} width={w * k} height="4" fill={TONE[tone]} />
79 </svg>
80 );
81}

What it pulls in

Other registry items

  • https://mocoui.site/r/tokens.json

Files it writes

  • registry/spark/spark.tsx
  • registry/spark/spark.css

Facts

Registry
moco
Type
registry:component
Access
Free
Files written
2
Licence
MIT
In the index
at or before 2026-08-16
Last confirmed
today

Go to the source

Docs on moco mocoui.site shreya0204/moco on GitHub Raw registry item This item as JSON

More from moco

All 20 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
CodecodemocoComponentsFree1 dep · 3 files
ComparecomparemocoComponentsFreeno deps · 2 files
Count UpcountupmocoComponentsFreeno deps · 2 files
CovercovermocoComponentsFreeno deps · 2 files
Diagram KitdiagrammocoComponentsFreeno deps · 2 files
Dot GriddotgridmocoComponentsFreeno deps · 2 files
FigurefiguremocoComponentsFreeno deps · 2 files
HookshooksmocoComponentsFreeno deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex