Skip to main content

Connect

connect

  • Type: {url?: string, method?: string, headers?: Record<string, string>}

Connection settings for the backend API.

PropertyTypeDefaultDescription
urlstring-Endpoint URL for the chart API
methodstring"POST"HTTP method
headersRecord<string, string>{"Content-Type": "application/json"}Request headers
<prompt-chart connect='{"url": "https://api.example.com/chart"}' prompt="Show sales by region"></prompt-chart>

prompt

  • Type: string

The natural language prompt to send to the backend.

<prompt-chart prompt="Show monthly revenue trend" demo></prompt-chart>

autoFetch

  • Type: boolean

When true, automatically fetches the chart when the component mounts (requires prompt and either connect.url or demo).

<prompt-chart prompt="Show user growth" demo autoFetch></prompt-chart>