Skip to content
Charts55Components12Visuals14ASCII45
GitHubGet startedGet started
All chartsYield curveFinance
PreviousNext: Options payoff

FinanceFI-12

Yield curve

Yield against maturity, today over earlier curves, with every stretch where longer money yields less shaded.

Part
FI-12
Component
YieldCurveCard
From
@lilt-ui/charts/finance

Treasury curve

-0.19%-0.19%2Y–10Y spread · inverted
1M5Y
Default01 / 02

Installation

One package, one sheet.

Add the package, then import the component and the stylesheet once. See Getting started for theming.

$npm install @lilt-ui/charts
import { YieldCurveCard } from '@lilt-ui/charts/finance';
import '@lilt-ui/charts/styles.css';

Usage

The default card.

The default card above, as you would write it.

<YieldCurveCard
  title="Treasury curve"
  data={curve}
  maturity="maturity"
  yield="today"
  versus={[{ key: 'yearAgo', label: 'A year ago' }]}
/>

Omit title to leave out the visible title. Set header={false} to remove the whole header, and use aria-label to name a chart inside your own card. legend={false} removes the legend independently. surface="ghost" controls only the visual frame. See Card composition.

Data

The shape it reads.

Maturities are spaced evenly in your order, as curves are usually read. The headline is the spread between two maturities, long minus short: 2Y to 10Y when the curve has both, otherwise its shortest and longest, or the pair you pass as spread. Below zero the curve is inverted and the caption says so. Every stretch where the curve falls as maturities lengthen is shaded. Earlier curves are drawn dashed and read in the tiles.

// One row per maturity, shortest first. Yields are in percent: 4.19 is 4.19%.
const curve = [
  { maturity: '2Y', today: 4.38, yearAgo: 5.04 },
  { maturity: '10Y', today: 4.19, yearAgo: 4.41 },
];

Props45

Every prop.

Every prop YieldCurveCard accepts, in the order you are likely to reach for them.

PropTypeDescription
titlestringOptional visible title. Omit to render no title. Also supplies the accessible name unless aria-label is set.
dataRow[]One row per x position. Omit when using ranges.
maturitytext key of RowEach maturity’s name, shortest first.
yieldnumeric key of RowToday’s yield, in percent.
labelstringNames today’s curve. Defaults to Today.
versus{ key, label?, color? }[]Earlier curves, drawn dashed.
spread[short, long]The maturities whose gap is the headline. Defaults to 2Y and 10Y.
depthbooleanDraws today’s curve as a lit tube with a soft shadow.
headerbooleanDefaults to true. False removes the whole header: title, headline, delta and period controls, with no reserved space. Pass data directly when your app owns period selection.
aria-labelstringAccessible chart name, independent of the visible title. Falls back to title, then a generic chart name.
deltanumberFractional change for the chip: 0.082 shows +8.2%.
deltaTone'default' | 'inverse' | 'neutral'Use inverse when a decrease is good.
headlinenumberResting headline. Defaults to the aggregate of non-reference series; dashed series are excluded.
rangestringStatic period label in the header.
ranges{ id, label, data, delta?, headline? }[]Turns the period label into a select. Each range swaps the data.
valueFormatIntl.NumberFormatOptionsFormats the headline, tiles, and axis, e.g. currency.
tilesbooleanPer-series value tiles. Defaults to true; false hides the legend.
legendfalse | 'tiles' | 'inline' | 'list' | 'pills' | 'bars'False removes the legend without changing the data. How the legend under the plot lays out: value tiles (default), a compact inline key, list rows, tinted pills, or bars that also draw each value against the largest.
legendSwatch'square' | 'dot' | 'line'The mark beside each legend label. Defaults to a rounded square.
heightnumberPlot height in pixels. Defaults to 240.
axis'minimal' | 'dots' | 'inline' | 'ruler' | 'classic' | 'segmented' | { x, y }Axis preset. Minimal (default) labels only the x ends and has no grid. Set one per axis with `{ x, y }`; a segmented axis can take a `gradient` to read as a range.
hover'pills' | 'tooltip' | 'strip' | 'headline'The one readout for the hovered point: pills on the axes (default), a tooltip with every series, a strip docked above the plot, or the headline and tiles alone.
hoverStyle'soft' | 'solid' | 'accent'How the pills or tooltip look. Soft (default) is surface glass; accent tints it with the hovered series.
pillPosition'auto' | 'mark' | 'axis'Where the value pill sits: above the hovered mark, or on the y axis. Auto picks mark when there are no y labels.
tooltipIndicator'square' | 'dot' | 'line'Series marker on each tooltip row, with hover="tooltip". Square by default.
background'dots' | 'grid' | 'lines' | 'none'Texture behind the marks. Dots by default, with a hover spotlight.
surface'elevated' | 'outline' | 'ghost'Card treatment. Ghost removes the visual frame only; header and legend are independent controls.
palette'spectrum' | 'iris' | 'cobalt' | 'emerald'Series colors. Spectrum by default; explicit series colors still win.
axisInsetnumberPadding between the plot edges and axis labels or pills.
loadingbooleanShows a neutral loading skeleton, not data.
loadingStyle'shimmer' | 'draw' | 'breathe'Shimmer sweeps a highlight over still shapes; draw reveals them in order; breathe lets them settle. Follows the selected look, including depth, and respects reduced motion.
empty'dots' | 'shape' | ReactElement | nullWhat the card shows when the period has no data. Dots (default) gathers a quiet dot field around the message; shape lays the chart’s own outline behind it. Pass `<ChartEmpty>` with your own words, any element of your own, or null for nothing. Both looks stay still, so empty never reads as loading, and the headline reads a dash, never zero.
syncstringLink hover and pins with every card that uses the same name, matched by x value. A click pins them all, with a ghost pin on the others; Alt-click pins one card only.
numberStyle'count' | 'pop' | 'slide' | 'roll' | 'flow' | 'scramble'How the headline animates when its value changes. Count (default) counts to the new value.
motion'auto' | 'none'None turns off decorative motion; reduced motion does this automatically.
defaultRangestringInitial range id; defaults to the first supplied range.
localestringLocale used for number formatting. Defaults to en-US.
formatValue(value: number) => stringCustom value text, taking precedence over valueFormat.
formatAxisValue(value: number) => stringCustom compact axis value text.
spotlightbooleanHighlight the inspected position in the plot background. Defaults to true.
badgeReactNodeContent in the tab above the card. A comparison badge can replace this while a comparison is active.
classNamestringAdditional class on the card frame.
styleCSSProperties | ChartStyleInline styles and scoped --lilt-* chart variables.
pillValue'series' | 'stack'Read an individual series value (default) or its stacked height. Has no effect when the card has no stacked series.
bleedbooleanLet marks reach the card edges with a soft fade.
Previous chartEarningsNext chartOptions payoff

Ready when your data is. Start with one install.

Install a package, import the stylesheet once, and drop in a card or a scene.

Read the guideRead the guideView on GitHubView on GitHub
ChartsAll chartsAll chartsFinanceFinanceCustomizeCustomizeFeaturesFeatures
ComponentsAll componentsAll componentsAIAIStatusStatusActionsActionsDataData
VisualsAll visualsAll visualsAIAIDataDataSecuritySecurityProductProduct
ASCIIAll scenesAll scenesTextTextInterfaceInterfaceBackgroundsBackgroundsMediaMediaDataData
DocsGetting startedGetting startedAPI referenceAPI referenceMotion & accessibilityMotion & accessibilityllms.txtllms.txt
React components with a little lilt.GitHubGitHubnpmnpm