ECharts adapter
Opt-in interactive charts via go-echarts + SDK script.
# ECharts SDK + Chart (opt-in module)
charts/echarts is a separate opt-in module: it wraps go-echarts RenderSnippet() output in a CSP-safe container and bridges dark mode — toggle the theme and watch the chart re-theme.
Go
import echarts "github.com/larsartmann/templ-components/charts/echarts"
@echarts.SDKScript(echarts.DefaultSDKScriptProps())
@echarts.EChart(echarts.EChartsProps{
Element: snippet.Element, // from go-echarts RenderSnippet()
Script: snippet.Script,
Nonce: nonce,
})