Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

11.6 KB
Raw Blame

Expand

Properties

Property Type Description
card? string | MetabaseCard An ad-hoc question to render without saving it first. Either a MetabaseCard object, or a serialized card string copied from a question URL hash (/question#<base64> or the bare base64).
className? string A custom class name to be added to the root element.
height? Height<string | number> A number or string specifying a CSS size value that specifies the height of the component
hiddenParameters? string[] A list of parameters to hide.
initialSqlParameters? SqlParameterValues Initial values for SQL parameters, slug-keyed. Applied once on mount; user widget edits afterwards are not reflected back to the host.
For each parameter:
- set to a value: that value is applied.
- set to null: strictly cleared, ignoring the parameter's default.
- omitted (or set to undefined): falls back to the parameter's default (or null if it has no default).
onSqlParametersChange? (payload: SqlParameterChangePayload) => void Fires on SQL parameters change. The payload's source distinguishes the initial state on load ('initial-state'), user edits in the UI ('manual-change'), and auto-updates ('auto-change').
query? MetabaseQueryObject | null A table-backed ad hoc query created with useMetabaseQueryObject.
questionId? SdkQuestionId | null The ID of the question.
This is either:
- the numerical ID when accessing a question link, i.e. http://localhost:3000/question/1-my-question where the ID is 1
- the string ID found in the entity_id key of the question object when using the API directly or using the SDK Collection Browser to return data
- new to show the notebook editor for creating new questions
- new-native to show the SQL editor for creating new native questions
sqlParameters? SqlParameterValues Controlled SQL parameter values, slug-keyed. On every render, this object replaces the question's parameter values:
- a parameter set to a value uses that value.
- a parameter set to null is cleared, even if it has a default.
- a parameter omitted from the object (or set to undefined) uses its default (or null if it has no default).

Pair with onSqlParametersChange to stay in sync with user edits.
style? CSSProperties A custom style object to be added to the root element.
title? SdkQuestionTitleProps Determines whether the question title is displayed, and allows a custom title to be displayed instead of the default question title. Shown by default.
token? string | null A valid JWT token for the guest embed.
width? Width<string | number> A number or string specifying a CSS size value that specifies the width of the component
withAlerts? boolean Enables the ability to set up alerts on the question.
withChartTypeSelector? boolean Determines whether the chart type selector and corresponding settings button are shown. Only relevant when using the default layout.
withDownloads? boolean Enables the ability to download results in the question.