Skip to content
Reeflow
Start Building

@reeflow/react

Defined in: apps/sdks/core/dist/types.d.ts:49

API error structure Matches the standard NestJS error response format

PropertyTypeDescriptionDefined in
code?stringOptional application-specific error code (e.g., ‘VALIDATION_ERROR’)apps/sdks/core/dist/types.d.ts:57
error?stringError type (e.g., ‘Bad Request’, ‘Unauthorized’, ‘Not Found’)apps/sdks/core/dist/types.d.ts:55
messagestringHuman-readable error messageapps/sdks/core/dist/types.d.ts:53
statusCodenumberHTTP status code (e.g., 400, 401, 404, 500)apps/sdks/core/dist/types.d.ts:51

Defined in: packages/types/dist/index.d.mts:20639

Query execution result Shared type for all query results across the Reeflow ecosystem

PropertyTypeDescriptionDefined in
columnsColumnInfo[]Column metadatapackages/types/dist/index.d.mts:20643
compile_time_msnumberCompilation time in milliseconds (parsing + analysis + validation + transformation)packages/types/dist/index.d.mts:20649
compiled_sqlstringCompiled SQL query after placeholder replacement and validationpackages/types/dist/index.d.mts:20653
execution_time_msnumberExecution time in millisecondspackages/types/dist/index.d.mts:20647
row_countnumberNumber of rows returnedpackages/types/dist/index.d.mts:20645
rowsunknown[][]Array of rows, where each row is an array of column valuespackages/types/dist/index.d.mts:20641
sqlstringOriginal SQL query before compilationpackages/types/dist/index.d.mts:20651

Defined in: apps/sdks/react/src/components/ReeflowContainer.tsx:9

Props for ReeflowContainer

PropertyTypeDescriptionDefined in
children?ReactNodeContent to display in the container (any custom content, icons, messages, actions, etc.)apps/sdks/react/src/components/ReeflowContainer.tsx:13
className?stringOptional CSS class nameapps/sdks/react/src/components/ReeflowContainer.tsx:15
label?stringOptional label displayed at the top of the componentapps/sdks/react/src/components/ReeflowContainer.tsx:11
style?CSSPropertiesOptional inline stylesapps/sdks/react/src/components/ReeflowContainer.tsx:17

Defined in: apps/sdks/core/dist/types.d.ts:167

Typed Reeflow event

  • CustomEvent
Type Parameter
T extends ReeflowEventType
PropertyModifierTypeDescriptionOverridesDefined in
detailreadonlyReeflowEventDetail[T]Returns any custom data event was created with. Typically used for synthetic events. MDN ReferenceCustomEvent.detailapps/sdks/core/dist/types.d.ts:169
typereadonly`reeflow-${T}`Returns the type of event, e.g. “click”, “hashchange”, or “submit”. MDN ReferenceCustomEvent.typeapps/sdks/core/dist/types.d.ts:168

Defined in: apps/sdks/core/dist/types.d.ts:119

Event detail mapping for type safety

This interface maps each Reeflow event type to its corresponding payload type. All events are prefixed with reeflow- when dispatched (e.g., reeflow-data-loaded).

// Listen to a typed event
element.addEventListener('reeflow-data-loaded', (e: ReeflowEvent<'data-loaded'>) => {
console.log(e.detail); // Type: QueryResult | EmbeddedWorkbook
});
PropertyTypeDescriptionDefined in
auth-change{ authToken: string; }Provider authentication token changedapps/sdks/core/dist/types.d.ts:121
auth-change.authTokenstring-apps/sdks/core/dist/types.d.ts:122
chart-clickChartClickDetailUser clicked on a chart data pointapps/sdks/core/dist/types.d.ts:153
chart-hoverChartHoverDetailUser hovered over a chart data pointapps/sdks/core/dist/types.d.ts:155
chart-legend-toggleChartLegendToggleDetailUser toggled a chart legend item visibilityapps/sdks/core/dist/types.d.ts:157
data-loaded| QueryResult | { description?: Record<string, string> | null; name: z.ZodRecord<z.ZodString, z.ZodString>; pages: { columns: number; content: ( | { config: { [key: string]: unknown; columns?: string[]; }; id: string; label?: string; layout: { height: number; width: number; x: number; y: number; }; query?: | { connection?: { config: …; type: …; }; connection_id?: string; parameters?: Record<…, …>; sql: string; type: SQL; } | { connection?: { config: …; type: …; }; connection_id?: string; dimensions?: …[]; filters?: …[]; joins?: …[]; limit?: string | number; measures: { color?: …; column?: …; label?: …; type: …; }[]; offset?: string | number; order_by?: …[]; parameters?: Record<…, …>; type: AGGREGATE; } | { columns?: …[]; connection?: { config: …; type: …; }; connection_id?: string; distinct?: boolean; filters?: …[]; joins?: …[]; limit?: string | number; offset?: string | number; order_by?: …[]; parameters?: Record<…, …>; type: TABLE; }; source?: { connection_id: string; database?: string; schema?: string; table: string; }; type: "table"; } | { config: { [key: string]: unknown; dimension?: | { column: string; label?: … | …; type: "categorical"; } | { column: string; date_range?: … | …; granularity: … | … | … | … | …; label?: … | …; type: "time"; }; measures?: { color?: …; column?: …; label?: …; type: …; }[]; }; id: string; label?: string; layout: { height: number; width: number; x: number; y: number; }; query?: | { connection?: { config: …; type: …; }; connection_id?: string; parameters?: Record<…, …>; sql: string; type: SQL; } | { connection?: { config: …; type: …; }; connection_id?: string; dimensions?: …[]; filters?: …[]; joins?: …[]; limit?: string | number; measures: { color?: …; column?: …; label?: …; type: …; }[]; offset?: string | number; order_by?: …[]; parameters?: Record<…, …>; type: AGGREGATE; } | { columns?: …[]; connection?: { config: …; type: …; }; connection_id?: string; distinct?: boolean; filters?: …[]; joins?: …[]; limit?: string | number; offset?: string | number; order_by?: …[]; parameters?: Record<…, …>; type: TABLE; }; source?: { connection_id: string; database?: string; schema?: string; table: string; }; type: "bar"; } | { config: { [key: string]: unknown; dimension?: | { column: string; label?: … | …; type: "categorical"; } | { column: string; date_range?: … | …; granularity: … | … | … | … | …; label?: … | …; type: "time"; }; measures?: { color?: …; column?: …; label?: …; type: …; }[]; }; id: string; label?: string; layout: { height: number; width: number; x: number; y: number; }; query?: | { connection?: { config: …; type: …; }; connection_id?: string; parameters?: Record<…, …>; sql: string; type: SQL; } | { connection?: { config: …; type: …; }; connection_id?: string; dimensions?: …[]; filters?: …[]; joins?: …[]; limit?: string | number; measures: { color?: …; column?: …; label?: …; type: …; }[]; offset?: string | number; order_by?: …[]; parameters?: Record<…, …>; type: AGGREGATE; } | { columns?: …[]; connection?: { config: …; type: …; }; connection_id?: string; distinct?: boolean; filters?: …[]; joins?: …[]; limit?: string | number; offset?: string | number; order_by?: …[]; parameters?: Record<…, …>; type: TABLE; }; source?: { connection_id: string; database?: string; schema?: string; table: string; }; type: "line"; } | { config: { [key: string]: unknown; label_field?: string; value_field?: string; }; id: string; label?: string; layout: { height: number; width: number; x: number; y: number; }; query?: | { connection?: { config: …; type: …; }; connection_id?: string; parameters?: Record<…, …>; sql: string; type: SQL; } | { connection?: { config: …; type: …; }; connection_id?: string; dimensions?: …[]; filters?: …[]; joins?: …[]; limit?: string | number; measures: { color?: …; column?: …; label?: …; type: …; }[]; offset?: string | number; order_by?: …[]; parameters?: Record<…, …>; type: AGGREGATE; } | { columns?: …[]; connection?: { config: …; type: …; }; connection_id?: string; distinct?: boolean; filters?: …[]; joins?: …[]; limit?: string | number; offset?: string | number; order_by?: …[]; parameters?: Record<…, …>; type: TABLE; }; source?: { connection_id: string; database?: string; schema?: string; table: string; }; type: "pie"; })[]; description?: Record<string, string> | null; max_rows: number; name: z.ZodRecord<z.ZodString, z.ZodString>; order: number; row_height: number; }[]; theme_css?: string; }Data was successfully loaded (QueryResult for tables/charts, EmbeddedWorkbook for workbooks)apps/sdks/core/dist/types.d.ts:134
errorApiErrorAn error occurred during component operationapps/sdks/core/dist/types.d.ts:132
state-change{ oldState: ReeflowComponentState; state: ReeflowComponentState; }Component state changed (loading, ready, error, etc.)apps/sdks/core/dist/types.d.ts:127
state-change.oldStateReeflowComponentState-apps/sdks/core/dist/types.d.ts:129
state-change.stateReeflowComponentState-apps/sdks/core/dist/types.d.ts:128
table-page-change{ page: number; }Table page changed (pagination)apps/sdks/core/dist/types.d.ts:145
table-page-change.pagenumber-apps/sdks/core/dist/types.d.ts:146
table-row-click{ row: Record<string, unknown> | unknown[]; }User clicked on a table rowapps/sdks/core/dist/types.d.ts:136
table-row-click.rowRecord<string, unknown> | unknown[]-apps/sdks/core/dist/types.d.ts:137
table-search-change{ searchTerm: string; }Table search term changedapps/sdks/core/dist/types.d.ts:149
table-search-change.searchTermstring-apps/sdks/core/dist/types.d.ts:150
table-sort-change{ column: string; direction: "asc" | "desc"; }Table sorting changedapps/sdks/core/dist/types.d.ts:140
table-sort-change.columnstring-apps/sdks/core/dist/types.d.ts:141
table-sort-change.direction"asc" | "desc"-apps/sdks/core/dist/types.d.ts:142
theme-changeThemeChangedTheme or theme mode changedapps/sdks/core/dist/types.d.ts:125
workbook-page-change{ page: number; previousPage: number; }Workbook page/tab changedapps/sdks/core/dist/types.d.ts:159
workbook-page-change.pagenumber-apps/sdks/core/dist/types.d.ts:160
workbook-page-change.previousPagenumber-apps/sdks/core/dist/types.d.ts:161

Defined in: apps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:11

Provider component that manages authentication context for child Reeflow components Acts as a context provider in the component tree

reeflow-auth-change - Fired when authentication context changes. Detail: { authToken: string }

reeflow-theme-change - Fired when theme or theme mode changes. Detail: { theme: string, themeMode: 'light' | 'dark' }

  • ReeflowEventEmitter
authHeader: string;

Defined in: apps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:42

The HTTP header name to use for authentication. Defaults to ‘X-Embed-Authorization’ for embedded user tokens. Use ‘Authorization’ for standard Bearer tokens (e.g., Clerk JWT).

authToken: string;

Defined in: apps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:36

baseUrl: any;

Defined in: apps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:43

debug: boolean;

Defined in: apps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:44

mock: boolean;

Defined in: apps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:45

theme: "default" | "ocean";

Defined in: apps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:46

themeMode: ThemeMode;

Defined in: apps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:47

optional themeStyle: string;

Defined in: apps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:63

CSS variables for theme customization (passed as inline style string)

Note: This property is named themeStyle instead of style because React has special handling for the style prop (it expects an object and calls .setProperty() on it). Using style directly would conflict with React’s built-in style handling and cause errors.

When this property changes, we sync it to the actual HTML style attribute in the updated() lifecycle method so CSS variables are applied to the element.

<ReeflowProvider themeStyle="--color-primary: #ff0000; --color-secondary: #00ff00" />
get protected sdkId(): string | undefined;

Defined in: apps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:28

SDK identifier for API tracking (e.g., “core”, “react”).

This is intentionally accessed via data attributes (data-sdk-id) rather than Lit properties for the following reasons:

  1. Internal use only: SDK info is not meant to be set by end users. Data attributes don’t appear in component API documentation or IDE autocomplete.

  2. Per-provider isolation: When a page uses both React and Core SDKs simultaneously, each provider instance can have its own SDK identity. The React SDK wrapper sets data-sdk-id="react" on its provider, while direct Core usage defaults to “core”.

  3. Build-time injection: SDK wrappers (like React) can inject these values at build time without exposing them as configurable props to consumers.

string | undefined

get protected sdkVersion(): string | undefined;

Defined in: apps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:34

SDK version for API tracking (semver format: x.y.z).

See sdkId getter for documentation on why this uses data attributes.

string | undefined

protected emitEvent<T>(type, data?): void;

Defined in: apps/sdks/core/dist/components/base/ReeflowEventEmitter.d.ts:38

Emit a standardized Reeflow custom event

Events are prefixed with reeflow- and configured to bubble through shadow DOM.

Type Parameter
T extends ReeflowEventType
ParameterTypeDescription
typeTEvent type (becomes reeflow-${type})
data?unknownEvent detail payload

void

this.emitEvent('data-loaded', { rows: 100 });
// Dispatches event: 'reeflow-data-loaded' with detail: { rows: 100 }
ReeflowEventEmitter.emitEvent
getApiClient(): ApiClient;

Defined in: apps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:84

Get the ApiClient instance for this provider

ApiClient

getAuthContext(): {
authToken: string;
};

Defined in: apps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:92

Get authentication context

{
authToken: string;
}
NameTypeDefined in
authTokenstringapps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:93
protected log(
level,
message,
data?): void;

Defined in: apps/sdks/core/dist/components/base/ReeflowEventEmitter.d.ts:23

Log a message with Reeflow prefix

ParameterTypeDescription
levelLogLevelLog level (log, error, warn, info, debug)
messagestringMessage to log
data?unknownOptional additional data to include in log

void

ReeflowEventEmitter.log
updateAuth(authToken, authHeader?): void;

Defined in: apps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:98

Update authentication context

ParameterType
authTokenstring
authHeader?string

void

connectedCallback(): void;

Defined in: apps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:76

Invoked when the component is added to the document’s DOM.

In connectedCallback() you should setup tasks that should only occur when the element is connected to the document. The most common of these is adding event listeners to nodes external to the element, like a keydown event handler added to the window.

connectedCallback() {
super.connectedCallback();
addEventListener('keydown', this._handleKeydown);
}

Typically, anything done in connectedCallback() should be undone when the element is disconnected, in disconnectedCallback().

void

ReeflowEventEmitter.connectedCallback
render(): TemplateResult<1>;

Defined in: apps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:99

Invoked on each update to perform rendering tasks. This method may return any value renderable by lit-html’s ChildPart - typically a TemplateResult. Setting properties inside this method will not trigger the element to update.

TemplateResult<1>

ReeflowEventEmitter.render
firstUpdated(): void;

Defined in: apps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:65

Invoked when the element is first updated. Implement to perform one time work on the element after update.

firstUpdated() {
this.renderRoot.getElementById('my-text-area').focus();
}

Setting properties inside this method will trigger the element to update again after this update cycle completes.

void

ReeflowEventEmitter.firstUpdated
updated(changedProperties): void;

Defined in: apps/sdks/core/dist/components/provider/ReeflowProvider.d.ts:66

Invoked whenever the element is updated. Implement to perform post-updating tasks via DOM APIs, for example, focusing an element.

Setting properties inside this method will trigger the element to update again after this update cycle completes.

ParameterType
changedPropertiesMap<string, unknown>

void

ReeflowEventEmitter.updated

Defined in: apps/sdks/react/src/hooks/useReeflowComponent.ts:15

Return type for useReeflowComponent hook

PropertyTypeDescriptionDefined in
data| QueryResult | undefinedQuery result data when availableapps/sdks/react/src/hooks/useReeflowComponent.ts:19
errorApiError | undefinedError object if an error occurredapps/sdks/react/src/hooks/useReeflowComponent.ts:21
isEmptybooleanConvenience boolean: true when state is ‘empty’apps/sdks/react/src/hooks/useReeflowComponent.ts:29
isErrorbooleanConvenience boolean: true when state is ‘error’apps/sdks/react/src/hooks/useReeflowComponent.ts:27
isLoadingbooleanConvenience boolean: true when state is ‘loading’apps/sdks/react/src/hooks/useReeflowComponent.ts:23
isReadybooleanConvenience boolean: true when state is ‘ready’apps/sdks/react/src/hooks/useReeflowComponent.ts:25
refresh() => voidRefresh the component by re-executing the current queryapps/sdks/react/src/hooks/useReeflowComponent.ts:31
reset(includeQuery?) => voidReset the component to its initial stateapps/sdks/react/src/hooks/useReeflowComponent.ts:33
state| ReeflowComponentState | undefinedCurrent component stateapps/sdks/react/src/hooks/useReeflowComponent.ts:17
type ConnectionConfig = z.infer<typeof ConnectionConfigSchema>;

Defined in: packages/types/dist/index.d.mts:759


type DataSourceType = typeof DataSourceTypes[number];

Defined in: packages/types/dist/index.d.mts:689


type ReeflowBarChartProps = Omit<ReeflowBarChartPropsGenerated, "ref"> & {
data?: QueryResult;
query?: JSONQLQuery;
};

Defined in: apps/sdks/react/src/components/ReeflowBarChart.tsx:17

Props for ReeflowBarChart component

All events are automatically available via the generated component:

  • Chart events: onChartClick, onChartHover, onChartLegendToggle
  • Standard events: onStateChange, onDataLoaded, onError
NameTypeDescriptionDefined in
data?QueryResultData to display in the chart (alternative to query)apps/sdks/react/src/components/ReeflowBarChart.tsx:19
query?JSONQLQueryQuery to execute to fetch data for the chartapps/sdks/react/src/components/ReeflowBarChart.tsx:21

type ReeflowComponentState = "initializing" | "loading" | "error" | "ready" | "empty";

Defined in: apps/sdks/core/dist/types.d.ts:8

State type for Reeflow components


type ReeflowEventType =
| "auth-change"
| "theme-change"
| "state-change"
| "error"
| "data-loaded"
| "table-row-click"
| "table-sort-change"
| "table-page-change"
| "table-search-change"
| "chart-click"
| "chart-hover"
| "chart-legend-toggle"
| "workbook-page-change";

Defined in: apps/sdks/core/dist/types.d.ts:62

Reeflow event types


type ReeflowLineChartProps = Omit<ReeflowLineChartPropsGenerated, "ref"> & {
data?: QueryResult;
query?: JSONQLQuery;
};

Defined in: apps/sdks/react/src/components/ReeflowLineChart.tsx:17

Props for ReeflowLineChart component

All events are automatically available via the generated component:

  • Chart events: onChartClick, onChartHover, onChartLegendToggle
  • Standard events: onStateChange, onDataLoaded, onError
NameTypeDescriptionDefined in
data?QueryResultData to display in the chart (alternative to query)apps/sdks/react/src/components/ReeflowLineChart.tsx:19
query?JSONQLQueryQuery to execute to fetch data for the chartapps/sdks/react/src/components/ReeflowLineChart.tsx:21

type ReeflowPieChartProps = Omit<ReeflowPieChartPropsGenerated, "ref"> & {
data?: QueryResult;
query?: JSONQLQuery;
};

Defined in: apps/sdks/react/src/components/ReeflowPieChart.tsx:17

Props for ReeflowPieChart component

All events are automatically available via the generated component:

  • Chart events: onChartClick, onChartHover, onChartLegendToggle
  • Standard events: onStateChange, onDataLoaded, onError
NameTypeDescriptionDefined in
data?QueryResultData to display in the chart (alternative to query)apps/sdks/react/src/components/ReeflowPieChart.tsx:19
query?JSONQLQueryQuery to execute to fetch data for the chartapps/sdks/react/src/components/ReeflowPieChart.tsx:21

type ReeflowProviderProps = Omit<ReeflowProviderPropsGenerated, "sdkId" | "sdkVersion">;

Defined in: apps/sdks/react/src/components/ReeflowProvider.tsx:18

Props for the ReeflowProvider component. Extends the generated props but omits internal SDK tracking fields.


type ReeflowTableProps = Omit<ReeflowTablePropsGenerated, "ref"> & {
data?: QueryResult;
query?: JSONQLQuery;
};

Defined in: apps/sdks/react/src/components/ReeflowTable.tsx:17

Props for ReeflowTable component

All events are automatically available via the generated component:

  • Table events: onTableRowClick, onTableSortChange, onTablePageChange, onTableSearchChange
  • Standard events: onStateChange, onDataLoaded, onError
NameTypeDescriptionDefined in
data?QueryResultData to display in the table (alternative to query)apps/sdks/react/src/components/ReeflowTable.tsx:19
query?JSONQLQueryQuery to execute to fetch data for the tableapps/sdks/react/src/components/ReeflowTable.tsx:21

type ReeflowWorkbookProps = Omit<ReeflowWorkbookPropsGenerated, "ref">;

Defined in: apps/sdks/react/src/components/ReeflowWorkbook.tsx:13

Props for ReeflowWorkbook component

All events are automatically available via the generated component:

  • Workbook events: onDataLoaded, onWorkbookPageChange
  • Standard events: onStateChange, onError
const DEFAULT_API_BASE_URL: string;

Defined in: apps/sdks/react/src/config.ts:9

Default API base URL Uses VITE_API_HOST environment variable if available, otherwise falls back to production URL


const DEFAULT_TEST_AUTH_TOKEN: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ0ZXN0IiwiaXNzIjoicmVlZmxvdyIsImF1ZCI6ImRhdGEtYXBpIiwiZXhwIjoxNzg5ODQ4MDIzLCJpYXQiOjE3NTgzMzA3NjksImp0aSI6InNlc3NfNmt0QWVnQ0ZTMUc3NjByZUx5WHJOZzVMZmdqIiwib3JnYW5pemF0aW9uX2lkIjoib3JnXzMyTmM1czh4OHBmcnJaWkl2VUtOR2xacFdBZSJ9.ydGlYK7qa0-gMkPGXI5tDwygMeMRmYkQWIDeXONQOFo" = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ0ZXN0IiwiaXNzIjoicmVlZmxvdyIsImF1ZCI6ImRhdGEtYXBpIiwiZXhwIjoxNzg5ODQ4MDIzLCJpYXQiOjE3NTgzMzA3NjksImp0aSI6InNlc3NfNmt0QWVnQ0ZTMUc3NjByZUx5WHJOZzVMZmdqIiwib3JnYW5pemF0aW9uX2lkIjoib3JnXzMyTmM1czh4OHBmcnJaWkl2VUtOR2xacFdBZSJ9.ydGlYK7qa0-gMkPGXI5tDwygMeMRmYkQWIDeXONQOFo';

Defined in: apps/sdks/react/src/config.ts:19

Default test auth token for development and testing This is a valid JWT token for testing with the Reeflow API Uses organization_id ‘demo-org’ matching the SPA demo environment


const DEFAULT_THEME: "default" = 'default';

Defined in: apps/sdks/react/src/config.ts:25

Default theme for Reeflow components


const DEFAULT_THEME_MODE: "auto" = 'auto';

Defined in: apps/sdks/react/src/config.ts:30

Default theme mode for Reeflow components


const DEFAULT_USE_MOCK: boolean;

Defined in: apps/sdks/react/src/config.ts:11


const ReeflowProvider: ForwardRefExoticComponent<Omit<ReeflowProviderProps, "ref"> & RefAttributes<ReeflowProviderElement>>;

Defined in: apps/sdks/react/src/components/ReeflowProvider.tsx:96

ReeflowProvider component wrapper that sets SDK tracking data attributes.

Uses forwardRef to allow consumers to access provider methods like getApiClient() and updateAuth().


const ReeflowWorkbook: ForwardRefExoticComponent<ReeflowWorkbookProps> = ReeflowWorkbookGenerated;

Defined in: apps/sdks/react/src/components/ReeflowWorkbook.tsx:32

ReeflowWorkbook component with React event handlers

Using React event handlers:

<ReeflowWorkbook
workbookId="workbook-123"
theme="ocean"
themeMode="light"
onDataLoaded={(workbook) => console.log('Workbook loaded:', workbook)}
onWorkbookPageChange={({ page, previousPage }) => console.log('Page changed:', page, previousPage)}
onStateChange={(state) => console.log('State:', state)}
onError={(error) => console.error('Error:', error.message)}
/>

const version: "0.0.1" = '0.0.1';

Defined in: apps/sdks/react/src/index.ts:27

function ReeflowBarChart(__namedParameters): Element;

Defined in: apps/sdks/react/src/components/ReeflowBarChart.tsx:40

ReeflowBarChart component with React event handlers

ParameterType
__namedParametersReeflowBarChartProps

Element

Using React event handlers:

<ReeflowBarChart
label="Component Title"
query={query}
onStateChange={(state) => console.log('State:', state)}
onDataLoaded={(data) => console.log('Data loaded:', data.row_count, 'rows')}
onError={(error) => console.error('Error:', error.message)}
onChartClick={(detail) => console.log('Clicked bar:', detail.name, detail.value)}
/>

function ReeflowContainer(__namedParameters): Element;

Defined in: apps/sdks/react/src/components/ReeflowContainer.tsx:44

ParameterType
__namedParametersReeflowContainerProps

Element


function ReeflowLineChart(__namedParameters): Element;

Defined in: apps/sdks/react/src/components/ReeflowLineChart.tsx:40

ReeflowLineChart component with React event handlers

ParameterType
__namedParametersReeflowLineChartProps

Element

Using React event handlers:

<ReeflowLineChart
label="Component Title"
query={query}
onStateChange={(state) => console.log('State:', state)}
onDataLoaded={(data) => console.log('Data loaded:', data.row_count, 'rows')}
onError={(error) => console.error('Error:', error.message)}
onChartClick={(detail) => console.log('Clicked:', detail.name, detail.value)}
/>

function ReeflowPieChart(__namedParameters): Element;

Defined in: apps/sdks/react/src/components/ReeflowPieChart.tsx:40

ReeflowPieChart component with React event handlers

ParameterType
__namedParametersReeflowPieChartProps

Element

Using React event handlers:

<ReeflowPieChart
label="Component Title"
query={query}
onStateChange={(state) => console.log('State:', state)}
onDataLoaded={(data) => console.log('Data loaded:', data.row_count, 'rows')}
onError={(error) => console.error('Error:', error.message)}
onChartClick={(detail) => console.log('Clicked slice:', detail.name, detail.value)}
/>

function ReeflowTable(__namedParameters): Element;

Defined in: apps/sdks/react/src/components/ReeflowTable.tsx:43

ReeflowTable component with React event handlers

ParameterType
__namedParametersReeflowTableProps

Element

Using React event handlers:

<ReeflowTable
label="Component Title"
query={query}
onStateChange={(state) => console.log('State:', state)}
onDataLoaded={(data) => console.log('Data loaded:', data.row_count, 'rows')}
onError={(error) => console.error('Error:', error.message)}
onTableRowClick={(detail) => console.log('Row clicked:', detail)}
onTableSortChange={(detail) => console.log('Sort changed:', detail.column, detail.direction)}
onTablePageChange={(detail) => console.log('Page changed:', detail)}
onTableSearchChange={(detail) => console.log('Search:', detail)}
/>

function useReeflowComponent(componentId): UseReeflowComponentResult;

Defined in: apps/sdks/react/src/hooks/useReeflowComponent.ts:102

Hook to access a Reeflow component’s state, data, and control methods

This hook provides a React-friendly way to access and control Reeflow components without manually managing refs or event listeners.

ParameterTypeDescription
componentIdstringThe unique ID of the Reeflow component (must match the component’s id prop)

UseReeflowComponentResult

Object containing state, data, error, convenience booleans, and control methods

Basic usage with loading and error states

function SalesChart() {
const { data, isLoading, isError, error } = useReeflowComponent('sales-chart');
return (
<div>
{isLoading && <Spinner />}
{isError && <ErrorMessage error={error} />}
{data && <p>Loaded {data.row_count} rows</p>}
<ReeflowBarChart id="sales-chart" query={query} />
</div>
);
}

Using refresh and reset methods

function InteractiveChart() {
const { data, refresh, reset } = useReeflowComponent('chart');
return (
<div>
<button onClick={refresh}>Refresh Data</button>
<button onClick={() => reset(true)}>Reset Query</button>
<ReeflowBarChart id="chart" query={query} />
</div>
);
}

Dashboard with multiple components

function Dashboard() {
const revenue = useReeflowComponent('revenue-chart');
const orders = useReeflowComponent('orders-chart');
const isLoading = revenue.isLoading || orders.isLoading;
const hasErrors = revenue.isError || orders.isError;
return (
<div>
{isLoading && <p>Loading dashboard...</p>}
{hasErrors && <p>Some charts failed to load</p>}
<ReeflowBarChart id="revenue-chart" query={revenueQuery} />
<ReeflowLineChart id="orders-chart" query={ordersQuery} />
</div>
);
}