Skip to content
Charts55Components12Visuals14ASCII45
GitHubGet startedGet started
All chartsOptions payoffFinance
PreviousNext

FinanceFI-13

Options payoff

An options strategy at expiry: profit or loss wherever the price ends, with today’s price and every breakeven marked.

Part
FI-13
Component
PayoffChartCard
From
@lilt-ui/charts/finance

Bull call spread

−$230−$230at $204.00 today
Max profit
+$1,370
Max loss
−$630
Breakeven
$206.30
Today $204.00$134.00$210.63
Default01 / 03

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 { PayoffChartCard } from '@lilt-ui/charts/finance';
import '@lilt-ui/charts/styles.css';

Usage

The default card.

The default card above, as you would write it.

<PayoffChartCard
  title="Bull call spread"
  spot={204}
  legs={[
    { type: 'call', strike: 200, premium: 9.4 },
    { type: 'call', side: 'short', strike: 220, premium: 3.1 },
  ]}
/>

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. surface="ghost" controls only the visual frame. See Card composition.

Data

The shape it reads.

Every leg expires together. A long option pays its premium and a short one receives it; option quantities are contracts of multiplier shares (100 by default), and stock quantities are shares held from strike. Breakevens are found exactly where the curve crosses zero. Max profit or max loss reads Unlimited when it keeps growing as the price rises. payoffAt and payoffSummary return the same numbers for your own layouts.

// Each leg: a call, put, or stock; long (default) or short; its strike, premium and quantity.
const legs = [
  { type: 'call', strike: 200, premium: 9.4 },
  { type: 'call', side: 'short', strike: 220, premium: 3.1, quantity: 1 },
];

Props23

Every prop.

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

PropTypeDescription
titlestringOptional visible title. Also names the chart unless aria-label is set.
headerbooleanFalse removes the title, headline and stats. Defaults to true.
aria-labelstringAccessible name, independent of the visible title.
legs{ type, side?, strike, premium?, quantity? }[]The positions, all expiring together.
spotnumberToday’s price: marked, and read at rest.
priceRange[low, high]Prices to draw. Defaults to 30% around the strikes and spot.
multipliernumberShares per contract. Defaults to 100.
valueFormatIntl.NumberFormatOptionsMoney format for profit and loss. Whole US dollars by default.
priceFormatIntl.NumberFormatOptionsPrice format for the underlying. Defaults to valueFormat with cents.
localestringLocale for numbers; defaults to en-US.
heightnumberPlot height in pixels. Defaults to 220.
depthbooleanDraws the payoff line as a lit tube with a soft shadow.
axis'minimal' | 'dots' | 'inline' | 'ruler' | 'classic' | 'segmented'Axis preset.
background'dots' | 'grid' | 'lines' | 'none'Texture behind the plot.
hoverStyle'soft' | 'solid' | 'accent'How the pills look.
surface'elevated' | 'outline' | 'ghost'Card treatment.
numberStyle'count' | 'pop' | 'slide' | 'roll' | 'flow' | 'scramble'Headline number animation. Count by default.
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.
motion'auto' | 'none'None turns off decorative motion.
classNamestringClass on the card frame.
styleCSSProperties | ChartStyleInline styles and scoped chart variables.
Previous chartYield curve

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