StockTicker
A watchlist. When a price changes its row washes green or red and fades, the trend line extends and the change pill turns with its sign. Finance.
Open playground- AAPL$227.520.63%
- MSFT$431.180.63%
- NVDA$138.072.12%
- TSLA$248.401.72%
- AMZN$197.930.78%
About
StockTicker is a React component in the Finance category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { StockTicker } from "@ashutoshswamy/smoui" and set items, currency.
Install
npm i @ashutoshswamy/smouiUsage
import { StockTicker } from "@ashutoshswamy/smoui";
<StockTicker items={[{ symbol: "AAPL", name: "Apple Inc.", price: 227.52, open: 226.1 }]} />Props 2
- items
Quotes. Change `price` as new ticks arrive; the change is measured from `open`.
{ symbol; name; price; open; history? }[]- currency
ISO currency code.
stringdefault"USD"
More finance components
- AmountInputA big amount field. Digits group as you type, the figure shakes and turns red past your balance, and chips add to it or fill the max.
- BalanceChartBalance over time. Switch the range and the line morphs; drag across it and the figure follows with the change since the start.
- CandlestickChartCandles that grow from their middle when scrolled into view. Point at one: the rest dim and a readout gives open, high, low and close.
- CardFormA payment card that fills in as you type. Digits group themselves, the brand is read from the first numbers, the number is checked with Luhn, and the card turns over when you reach the CVC.
- CreditCardA card that tilts toward the pointer and flips to its back. The number is masked down to the last four digits.
- CurrencySwapA two-way converter. Type an amount and the result eases to its value; the swap button turns the pair around.