Magoo Component UI logo Magoo Component UI
← Catalog

Portfolio Rebalance

portfolio-rebalance organism experimental

A target-vs-actual allocation panel - per holding a bar of actual weight with a target marker and a drift pill when off-target.

The width preview needs a screen wider than the chosen width — use a larger device (or a desktop browser) to see the desktop and tablet layouts.

Default
US equities +8.0%
Actual 58% Target 50%
International equities
Actual 17% Target 20%
Bonds -6.0%
Actual 14% Target 20%
Cash
Actual 11% Target 10%
OnTarget
Growth
Actual 61% Target 60%
Value
Actual 24% Target 25%
Bonds
Actual 15% Target 15%

Props

NameTypeReq
holdings array ✓

Related components

How to use

There is no JavaScript - the panel is static markup. Each actual bar's width and the target marker's left position are set inline from the item's actual_pct and target_pct. The per-row bar colour comes from the caller-supplied color_class; a hidden safelist span lists the tokenized background utilities (bg-primary, bg-accent, bg-success, ...) so Tailwind keeps them. The drift pill is gated with data-if so it shows only when drift is passed.

Use cases

datalist WCAG AA SEO 20 dir: both ai-generated