Controls

Flow Hub

Effect
Preview
Reduced motion

Simulates prefers-reduced-motion for the demo. Off follows your system setting.

Keyboard stepping

Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.

Flow Hub

Sales by source and destination
FlowDirectionValue
BusinessIn$23K
PresentationIn$14.6K
FinanceIn$12.7K
DevelopmentIn$23.1K
InvestmentsOut$28.6K
StartupsOut$15.8K
OperationsOut$9.1K
ReservesOut$19.8K

Flow Hub

Ribbons that gather into a central total and fan back out to where it went.

Installation

npx shadcn@latest add ikislay/pixel-ui/flow-hub

How to use

import { FlowHub } from "@/components/ui/flow-hub"
export function Demo() {
return (
<FlowHub
label="Sales by source and destination"
totalLabel="Total sales"
inputs={[
{ label: "Business", value: 22987 },
{ label: "Finance", value: 12657 },
]}
outputs={[
{ label: "Investments", value: 26644 },
{ label: "Startups", value: 9000 },
]}

Source Code

// Loading…

Props

Options you can pass to customize this component.

Prop
Type
Description
inputs*
{ label: string; value: number; color?: string }[]

What flows in on the left. Their sum is the total in the center.

outputs*
{ label: string; value: number; color?: string }[]

Where it goes on the right. Colors carry on through the palette after the inputs.

label*
string

Names the chart for screen readers and captions its data table.

totalLabel
string

The caption above the total in the center.

format
(value: number) => string

Formats values wherever the chart shows them. Defaults to short numbers like 12.4K.

height
number

Height in pixels. The width fills the parent, with room for labels on both sides.

className
string

Merged onto the root element.