Embedded analytics SDK API
    Preparing search index...

    Function InteractiveQuestion

    • A component that renders an interactive question.

      Parameters

      • props: InteractiveQuestionProps
        • Optionalchildren?: ReactNode

          The children of the MetabaseProvider component.s

        • OptionalclassName?: string

          A custom class name to be added to the root element.

        • OptionalentityTypeFilter?: EntityTypeFilterKeys[]

          An array that specifies which entity types are available in the data picker

        • Optionalheight?: Height<string | number>

          A number or string specifying a CSS size value that specifies the height of the component

        • OptionalinitialSqlParameters?: ParameterValues

          Initial values for the SQL parameters.

        • OptionalisSaveEnabled?: boolean

          Whether to show the save button.

        • OptionalonBeforeSave?: (
              question: undefined | MetabaseQuestion,
              context: { isNewQuestion: boolean },
          ) => Promise<void>

          A callback function that triggers before saving. Only relevant when isSaveEnabled = true

        • OptionalonSave?: (
              question: undefined | MetabaseQuestion,
              context: { isNewQuestion: boolean },
          ) => void

          A callback function that triggers when a user saves the question. Only relevant when isSaveEnabled = true

        • Optionalplugins?: MetabasePluginsConfig
        • questionId: null | SdkQuestionId

          The ID of the question. This is either:

          • The numerical ID when accessing a question link, e.g., http://localhost:3000/question/1-my-question where the ID is 1
          • The entity_id key of the question object. You can find a question's Entity ID in the info panel when viewing a question
          • new to show the notebook editor for creating new questions. isSaveEnabled must be true to allow saving the question
        • Optionalstyle?: CSSProperties

          A custom style object to be added to the root element.

        • OptionaltargetCollection?: SdkCollectionId

          The collection to save the question to. This will hide the collection picker from the save modal. Only applicable to interactive questions.

        • Optionaltitle?: 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. Only applicable to interactive questions when using the default layout.

        • Optionalwidth?: Width<string | number>

          A number or string specifying a CSS size value that specifies the width of the component

        • OptionalwithChartTypeSelector?: boolean

          Determines whether the chart type selector and corresponding settings button are shown. Only relevant when using the default layout.

        • OptionalwithDownloads?: boolean

          Enables the ability to download results in the interactive question.

        • OptionalwithResetButton?: boolean

          Determines whether a reset button is displayed. Only relevant when using the default layout.

      Returns null | Element

    Index

    InteractiveQuestion

    BackButton: (props: InteractiveQuestionBackButtonProps) => null | Element

    Type declaration

    Breakout: () => null | Element

    Type declaration

      • (): null | Element
      • Function

        A set of badges for managing data groupings (breakouts). Uses question context for breakout functionality.

        Returns null | Element

    BreakoutDropdown: (
        props: InteractiveQuestionBreakoutDropdownProps,
    ) => null | Element

    Type declaration

    ChartTypeDropdown: (props: MenuProps) => Element

    Type declaration

      • (props: MenuProps): Element
      • Function

        Dropdown for selecting the visualization type (bar chart, line chart, table, etc.). Automatically updates to show recommended visualization types for the current data.

        Parameters

        Returns Element

    ChartTypeSelector: (props: StackProps) => Element

    Type declaration

    DownloadWidget: (props: StackProps) => null | Element

    Type declaration

      • (props: StackProps): null | Element
      • Function

        Provides a UI widget for downloading data in different formats (CSV, XLSX, JSON, and PNG depending on the visualization).

        Parameters

        Returns null | Element

    DownloadWidgetDropdown: (props: PopoverProps) => Element

    Type declaration

    Editor: (props: InteractiveQuestionEditorProps) => undefined | Element

    Type declaration

    EditorButton: (
        props: InteractiveQuestionEditorButtonProps,
    ) => undefined | false | Element

    Type declaration

    Type declaration

    FilterDropdown: (
        props: InteractiveQuestionFilterDropdownProps,
    ) => null | Element

    Type declaration

    Notebook: (props: InteractiveQuestionEditorProps) => undefined | Element

    Type declaration

    Use InteractiveQuestion.Editor instead

    NotebookButton: (
        props: InteractiveQuestionEditorButtonProps,
    ) => undefined | false | Element

    Type declaration

    Use InteractiveQuestion.EditorButton instead

    QuestionSettings: (props: StackProps) => null | Element

    Type declaration

      • (props: StackProps): null | Element
      • Function

        Settings panel for configuring visualization options like axes, colors, and formatting. Uses question context for settings.

        Parameters

        Returns null | Element

    QuestionSettingsDropdown: (
        props?: InteractiveQuestionQuestionSettingsDropdownProps,
    ) => Element

    Type declaration

    QuestionVisualization: (props: FlexibleSizeProps) => Element

    Type declaration

    ResetButton: (props?: ButtonProps) => null | Element

    Type declaration

      • (props?: ButtonProps): null | Element
      • Function

        Button to reset question modifications. Only appears when there are unsaved changes to the question.

        Parameters

        Returns null | Element

    Type declaration

    SaveQuestionForm: (
        props: InteractiveQuestionSaveQuestionFormProps,
    ) => null | Element

    Type declaration

    Summarize: () => Element

    Type declaration

      • (): Element
      • Function

        Interface for adding and managing data summaries (like counts, sums, averages). Displays as a set of badges. Uses question context for summarization functionality.

        Returns Element

    SummarizeDropdown: (props: InteractiveQuestionSummarizeDropdownProps) => Element

    Type declaration

    Title: (props: CommonStylingProps) => undefined | Element

    Type declaration

      • (props: CommonStylingProps): undefined | Element
      • Function

        Displays a title based on the question's state. Shows:

        • The question's display name if it's saved
        • An auto-generated description for ad-hoc questions (non-native queries)
        • "New question" as fallback or for new/native queries

        Parameters

        Returns undefined | Element