Velocity X Components

Stats & Numbers

Percentage Split Bar

A single horizontal bar divided into labelled proportions — traffic sources, plan mix, budget allocation — with a legend underneath carrying the exact share for every segment. Built for the "these parts make one hundred percent" read in one horizontal sweep, with a table fallback for anyone who can't read the bar visually.

Subscription Included with the Velocity Components subscription.
bash
$ velocityx add percentage-split-bar

Built for astro.

Full docs for Percentage Split Bar →

Needs a licence key — subscribe here, then velocityx loginonce.

astro v1.0.1
Percentage Split Bar

Traffic by source

100 total
  • Organic search 48%
  • Direct 24%
  • Referral 16%
  • Social 8%
  • Other 4%
Traffic by source — exact values
SegmentValueShare
Organic search 48 48%
Direct 24 24%
Referral 16 16%
Social 8 8%
Other 4 4%

Props

NameTypeRequiredDefaultDescription
titlestringNo'Traffic by source'
segmentsSplitSegment[]No[ { label: 'Organic search', value: 48 }, { label: 'Direct', value: 24 }, { label: 'Referral', value: 16 }, { label: 'Social', value: 8 }, { label: 'Other', value: 4 }, ]
totalLabelstringNoPre-formatted override for the total, shown beside the title.
localestringNo'en-US'
classNamestringNo''

File this creates

The CLI writes this path into your project, relative to its root — nothing else moves.

text
components/velocity/percentage-split-bar/PercentageSplitBar.astro

Using the Percentage Split Bar component

Install it with velocityx add percentage-split-bar. The CLI writes the source straight into your project — no runtime dependency, no registry lock-in, and it themes itself from the same primary-*/accent-* scale as the rest of the library.

More from Stats & Numbers.