---
title: "Interface InteractiveQuestionProps"
url: "https://www.metabase.com/docs/latest/embedding/sdk/api/InteractiveQuestionProps"
version: "65"
---

> For the complete documentation index, see [llms.txt](https://www.metabase.com/docs/llms.txt).

# Interface InteractiveQuestionProps

**`Expand`**

## Properties

| Property                                                    | Type                                                                                                                                                                                                                                                                                                                | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| :---------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `card?`                                   | `string` \| [`MetabaseCard`](https://www.metabase.com/docs/latest/embedding/sdk/api/MetabaseCard.md)                                                                                                                                                                                                                                                                 | An ad-hoc question to render without saving it first. Either a [MetabaseCard](https://www.metabase.com/docs/latest/embedding/sdk/api/MetabaseCard.md) 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.                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `dataPicker?`                       | [`EmbeddingDataPicker`](https://www.metabase.com/docs/latest/embedding/sdk/api/EmbeddingDataPicker.md)                                                                                                                                                                                                                                                               | Controls the menu for selecting data sources in questions. You can opt for the full data picker by setting `dataPicker = "staged"`.                                                                                                                                                                                                                                                                                                                                                        |
| `entityTypes?`                     | [`EmbeddingEntityType`](https://www.metabase.com/docs/latest/embedding/sdk/api/EmbeddingEntityType.md)[]                                                                                                                                                                                                                                                             | An array that specifies which entity types are available in the data picker                                                                                                                                                                                                                                                                                                                                                                                                                |
| `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.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `initialCollection?`         | [`SdkCollectionId`](https://www.metabase.com/docs/latest/embedding/sdk/api/SdkCollectionId.md)                                                                                                                                                                                                                                                                       | The collection to preselect in the save modal's collection picker. Unlike `targetCollection`, the picker remains visible and the user can choose a different collection. Ignored when `targetCollection` is set.                                                                                                                                                                                                                                                                           |
| `initialSqlParameters?`   | [`SqlParameterValues`](https://www.metabase.com/docs/latest/embedding/sdk/api/SqlParameterValues.md)                                                                                                                                                                                                                                                                 | Initial values for SQL parameters, slug-keyed. Applied once on mount; user widget edits afterwards are not reflected back to the host. <br/> For each parameter: <br/> - set to a value: that value is applied. <br/> - set to `null`: strictly cleared, ignoring the parameter's default. <br/> - omitted (or set to `undefined`): falls back to the parameter's default (or `null` if it has no default).                                                                                |
| `isSaveEnabled?`                 | `boolean`                                                                                                                                                                                                                                                                                                           | Whether to show the save button.                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `onBeforeSave?`                   | (`question`: [`MetabaseQuestion`](https://www.metabase.com/docs/latest/embedding/sdk/api/MetabaseQuestion.md) \| `undefined`, `context`: \{ `isNewQuestion`: `boolean`; \}) => [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\>                                                                             | A callback function that triggers before saving. Only relevant when `isSaveEnabled = true`                                                                                                                                                                                                                                                                                                                                                                                                 |
| `onNavigateBack?`               | () => `void`                                                                                                                                                                                                                                                                                                        | A callback function that triggers when a user clicks the back button.                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `onRun?`                                 | (`question`: [`MetabaseQuestion`](https://www.metabase.com/docs/latest/embedding/sdk/api/MetabaseQuestion.md) \| `undefined`) => `void`                                                                                                                                                                                                                              | A callback function that triggers when a question is updated, including when a user clicks the `Visualize` button in the question editor                                                                                                                                                                                                                                                                                                                                                   |
| `onSave?`                               | (`question`: [`MetabaseQuestion`](https://www.metabase.com/docs/latest/embedding/sdk/api/MetabaseQuestion.md), `context`: \{ `dashboardTabId?`: `number`; `isNewQuestion`: `boolean`; \}) => `void`                                                                                                                                                                  | A callback function that triggers when a user saves the question. Only relevant when `isSaveEnabled = true`                                                                                                                                                                                                                                                                                                                                                                                |
| `onSqlParametersChange?` | (`payload`: [`SqlParameterChangePayload`](https://www.metabase.com/docs/latest/embedding/sdk/api/SqlParameterChangePayload.md)) => `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'`).                                                                                                                                                                                                                                                                                          |
| `onVisualizationChange?` | (`display`: \| `"object"` \| `"table"` \| `"bar"` \| `"line"` \| `"pie"` \| `"scalar"` \| `"row"` \| `"area"` \| `"combo"` \| `"pivot"` \| `"smartscalar"` \| `"gauge"` \| `"progress"` \| `"funnel"` \| `"map"` \| `"scatter"` \| `"boxplot"` \| `"waterfall"` \| `"sankey"` \| `"treemap"` \| `"list"`) => `void` | A callback function that triggers when the visualization type changes.                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `plugins?`                             | [`MetabasePluginsConfig`](https://www.metabase.com/docs/latest/embedding/sdk/api/MetabasePluginsConfig.md)                                                                                                                                                                                                                                                           | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `query?`                                 | [`MetabaseQueryObject`](https://www.metabase.com/docs/latest/embedding/sdk/api/MetabaseQueryObject.md) \| `null`                                                                                                                                                                                                                                                     | A table-backed ad hoc query created with `useMetabaseQueryObject`.                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `questionId?`                       | [`SdkQuestionId`](https://www.metabase.com/docs/latest/embedding/sdk/api/SdkQuestionId.md) \| `null`                                                                                                                                                                                                                                                                 | The ID of the question. <br/> This is either: <br/> - the numerical ID when accessing a question link, i.e. `http://localhost:3000/question/1-my-question` where the ID is `1` <br/> - 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 <br/> - `new` to show the notebook editor for creating new questions <br/> - `new-native` to show the SQL editor for creating new native questions |
| `sqlParameters?`                 | [`SqlParameterValues`](https://www.metabase.com/docs/latest/embedding/sdk/api/SqlParameterValues.md)                                                                                                                                                                                                                                                                 | Controlled SQL parameter values, slug-keyed. On every render, this object replaces the question's parameter values: <br/> - a parameter set to a value uses that value. <br/> - a parameter set to `null` is cleared, even if it has a default. <br/> - a parameter omitted from the object (or set to `undefined`) uses its default (or `null` if it has no default). <br/> <br/> Pair with `onSqlParametersChange` to stay in sync with user edits.                                      |
| `style?`                                 | [`CSSProperties`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/0b728411cd1dfb4bd26992bb35a73cf8edaa22e7/types/react/index.d.ts#L2579)                                                                                                                                                                    | A custom style object to be added to the root element.                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `targetCollection?`           | [`SdkCollectionId`](https://www.metabase.com/docs/latest/embedding/sdk/api/SdkCollectionId.md)                                                                                                                                                                                                                                                                       | The collection to save the question to. This will hide the collection picker from the save modal. Only applicable to interactive questions.                                                                                                                                                                                                                                                                                                                                                |
| `title?`                                 | [`SdkQuestionTitleProps`](https://www.metabase.com/docs/latest/embedding/sdk/api/SdkQuestionTitleProps.md)                                                                                                                                                                                                                                                           | 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.                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `withEditorButton?`           | `boolean`                                                                                                                                                                                                                                                                                                           | Determines whether the editor button is shown. Only relevant when using the default layout.                                                                                                                                                                                                                                                                                                                                                                                                |
