Embedded analytics SDK API
    Preparing search index...

    Interface StaticDashboardProps

    interface StaticDashboardProps {
        autoRefreshInterval?: number;
        className?: string;
        dashboardId?: SdkDashboardId | null;
        dataPickerProps?: Pick<SdkQuestionProps, "entityTypes">;
        hiddenParameters?: string[];
        initialParameters?: ParameterValues;
        onLoad?: (dashboard: MetabaseDashboard | null) => void;
        onLoadWithoutCards?: (dashboard: MetabaseDashboard | null) => void;
        onParametersChange?: (payload: ParameterChangePayload) => void;
        onVisualizationChange?: (
            visualization:
                | "object"
                | "table"
                | "bar"
                | "line"
                | "pie"
                | "scalar"
                | "row"
                | "area"
                | "combo"
                | "pivot"
                | "smartscalar"
                | "gauge"
                | "progress"
                | "funnel"
                | "map"
                | "scatter"
                | "boxplot"
                | "waterfall"
                | "sankey"
                | "list",
        ) => void;
        parameters?: ParameterValues;
        plugins?: MetabasePluginsConfig;
        style?: CSSProperties;
        token?: string
        | null;
        withCardTitle?: boolean;
        withDownloads?: boolean;
        withSubscriptions?: boolean;
        withTitle?: boolean;
    }
    Index

    Properties

    autoRefreshInterval?: number

    The interval between auto refreshes on the dashboard, in seconds.

    className?: string

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

    dashboardId?: SdkDashboardId | null

    The ID of the dashboard.
    This is either:

    • the numerical ID when accessing a dashboard link, i.e. http://localhost:3000/dashboard/1-my-dashboard where the ID is 1
    • the string ID found in the entity_id key of the dashboard object when using the API directly or using the SDK Collection Browser to return data
    dataPickerProps?: Pick<SdkQuestionProps, "entityTypes">

    Additional props to pass to the query builder rendered by InteractiveQuestion when creating a new dashboard question.

    hiddenParameters?: string[]

    A list of parameters to hide.

    initialParameters?: ParameterValues

    Initial values for query 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 (string for a single option, array of strings for multiple): 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).

    • Combining initialParameters and hiddenParameters to filter data on the frontend is a security risk.
    • Combining initialParameters and hiddenParameters to declutter the user interface is fine.
    onLoad?: (dashboard: MetabaseDashboard | null) => void

    Callback that is called when the dashboard is loaded.

    onLoadWithoutCards?: (dashboard: MetabaseDashboard | null) => void

    Callback that is called when the dashboard is loaded without cards.

    onParametersChange?: (payload: ParameterChangePayload) => void

    Fires on 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?: (
        visualization:
            | "object"
            | "table"
            | "bar"
            | "line"
            | "pie"
            | "scalar"
            | "row"
            | "area"
            | "combo"
            | "pivot"
            | "smartscalar"
            | "gauge"
            | "progress"
            | "funnel"
            | "map"
            | "scatter"
            | "boxplot"
            | "waterfall"
            | "sankey"
            | "list",
    ) => void

    A callback function that triggers when a question is opened from a dashboard card or when the user changes the visualization type of a question.

    Type Declaration

      • (
            visualization:
                | "object"
                | "table"
                | "bar"
                | "line"
                | "pie"
                | "scalar"
                | "row"
                | "area"
                | "combo"
                | "pivot"
                | "smartscalar"
                | "gauge"
                | "progress"
                | "funnel"
                | "map"
                | "scatter"
                | "boxplot"
                | "waterfall"
                | "sankey"
                | "list",
        ): void
      • Parameters

        • visualization:
              | "object"
              | "table"
              | "bar"
              | "line"
              | "pie"
              | "scalar"
              | "row"
              | "area"
              | "combo"
              | "pivot"
              | "smartscalar"
              | "gauge"
              | "progress"
              | "funnel"
              | "map"
              | "scatter"
              | "boxplot"
              | "waterfall"
              | "sankey"
              | "list"

          the new visualization type

        Returns void

    parameters?: ParameterValues

    Controlled parameter values, slug-keyed. On every render, this object replaces the dashboard'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 onParametersChange to stay in sync with user edits.
    • Combining parameters and hiddenParameters to filter data on the frontend is a security risk.
    • Combining parameters and hiddenParameters to declutter the user interface is fine.

    Additional mapper function to override or add drill-down menu. See the implementing custom actions section for more details.

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

    token?: string | null

    A valid JWT token for the guest embed.

    withCardTitle?: boolean

    Whether the dashboard cards should display a title.

    withDownloads?: boolean

    Whether to hide the download button.

    withSubscriptions?: boolean

    Whether to show the subscriptions button.

    withTitle?: boolean

    Whether the dashboard should display a title.