Skip to content

useWatchlist

Manage a list of tracked symbols with live price updates from your datafeed.

import { useWatchlist } from "react-klinecharts-ui";
const { items, addSymbol, removeSymbol, switchSymbol, activeSymbol } =
useWatchlist();
PropertyTypeDescription
itemsWatchlistItem[]Tracked symbols with price data
addSymbol(ticker: string) => voidAdd a symbol
removeSymbol(ticker: string) => voidRemove a symbol
switchSymbol(ticker: string) => voidDisplay a symbol on the chart
activeSymbolstring | nullCurrently displayed ticker
interface WatchlistItem {
ticker: string;
lastPrice: number | null;
change: number | null;
changePercent: number | null;
}

Price data comes from your Datafeed — the hook subscribes per tracked symbol and surfaces the latest values for rendering a watchlist panel.