Framework wrappers

Idiomatic wrappers for React, Vue, and Svelte. All three expose the same prop surface and forward a ref to the underlying Chart instance.

React

import { TradeCanvas, type TradeCanvasHandle } from '@tradecanvas/react'
import { BinanceAdapter } from '@tradecanvas/chart'
import { useRef } from 'react'

function App() {
  const chartRef = useRef<TradeCanvasHandle>(null)

  return (
    <TradeCanvas
      ref={chartRef}
      symbol="BTCUSDT"
      timeframe="5m"
      theme="dark"
      adapter={new BinanceAdapter()}
      onReady={(chart) => {
        chart.on('orderPlace', e => console.log(e.payload))
      }}
    />
  )
}

Vue

<script setup lang="ts">
import { TradeCanvas } from '@tradecanvas/vue'
import { BinanceAdapter } from '@tradecanvas/chart'

const adapter = new BinanceAdapter()
</script>

<template>
  <TradeCanvas
    symbol="BTCUSDT"
    timeframe="5m"
    theme="dark"
    :adapter="adapter"
    @ready="(chart) => console.log('ready', chart)"
  />
</template>

Svelte

<script lang="ts">
  import { TradeCanvas } from '@tradecanvas/svelte'
  import { BinanceAdapter } from '@tradecanvas/chart'

  const adapter = new BinanceAdapter()
</script>

<TradeCanvas
  symbol="BTCUSDT"
  timeframe="5m"
  theme="dark"
  {adapter}
  onReady={(chart) => console.log('ready', chart)}
/>

Shared props

PropTypeNotes
symbolstringRequired.
timeframeTimeFrame'1m' | '5m' | '15m' | '1h' | '4h' | '1d'
themeThemeName'dark' | 'light' | 'darkTerminal'
adapterDataAdapterLive stream source.
historyLimitnumberInitial bars to load.
tradingbooleanEnable trading overlay.
onReady(chart) => voidFires after the chart mounts.
The wrapper packages are currently demo/docs-only and not published to npm. Their source lives in packages/react, packages/vue, and packages/svelte — copy them into your project for now.