Skip to content

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

docs: add browser embedding in JS and background-light theme token (#63012)

Abed Habli686a52c70215
diff --git a/docs/embedding/embedded-analytics-js.md b/docs/embedding/embedded-analytics-js.md
index b08bc7359ed..18d6c19f2d9 100644
--- a/docs/embedding/embedded-analytics-js.md
+++ b/docs/embedding/embedded-analytics-js.md
@@ -19,6 +19,7 @@ Currently you can choose to embed:
- A dashboard
- A question (chart). You can embed both questions built with the query builder and questions built with SQL.
- Full graphical [query builder](../questions/query-builder/editor.md) to enable people to build their own charts and explorations.
+- A browser to navigate collections and open dashboards or questions.
## Quickstart
@@ -31,8 +32,12 @@ Currently you can choose to embed:
### 2. Create a new embed
1. In Metabase, click on **+ New** button in top right corner and select **Embed**. Note that this will only be visible to admins.
-2. Choose the type of entity to embed. Currently the available types are dashboard, question, and exploration (which will embed the Metabase query builder).
-3. Next, select the entity you want to embed.
+2. Choose the _type_ of entity to embed:
+ - dashboard
+ - question
+ - exploration (which will embed the Metabase query builder)
+ - browser.
+3. Next, select the entity you want to embed. For browser, pick the collection you want people to start from.
Once you've selected what you want to embed, click Next to customize your embed.
@@ -122,6 +127,8 @@ When you're creating a new embed using **+ New > Embed**, you'll see the followi
- **Show title**: what it says on the tin.
+- **Allow editing dashboards and questions**: lets people create and edit dashboards or questions in the current collection. When disabled, they can still perform actions like filter, summarize, and drill-through, but won’t be able to save results.”
+
## Configuring embeds
To define the configuration that applies to every embed on the page, use the `defineMetabaseConfig()` function. Its parameters include:
@@ -348,3 +355,19 @@ To render a question (chart).
- `initial-sql-parameters` - default value for SQL parameters, only applicable to native SQL questions, like `{ "productId": "42" }`
- `is-save-enabled` (default is false)
- `target-collection` - this is to enforce saving into a particular collection. Values: regular ID, entity ID, `"personal”`, `"root”`
+
+- ### Browser
+
+To render a collection browser so people can navigate a collection and open dashboards or questions.
+
+ ```html
+<metabase-browser initial-collection="14" read-only="false"></metabase-browser>
+```
+
+**Required parameters:**
+
+- `initial-collection` - This can be a collection ID or `root`. Use a collection ID (e.g., `14`) to start in a specific collection. Use `root` to start at the top-level, "Our Analytics" collection.
+
+**Optional parameters:**
+
+- `read-only` (default is true) – if true, people can interact with items (filter, summarize, drill-through) but cannot save. If false, they can create and edit items in the collection.
diff --git a/docs/embedding/sdk/snippets/appearance/theme.ts b/docs/embedding/sdk/snippets/appearance/theme.ts
index b8aa1460f7f..4288f290182 100644
--- a/docs/embedding/sdk/snippets/appearance/theme.ts
+++ b/docs/embedding/sdk/snippets/appearance/theme.ts
@@ -37,6 +37,10 @@ const theme = defineMetabaseTheme({
// Default background color
background: "#FFFFFF",
+ // Light background color for some control backgrounds.
+ // Defaults are derived from `background` (slightly darker in light mode, much lighter in dark mode).
+ "background-light": "#F0F2F5",
+
// Slightly muted background color.
"background-secondary": "#EDF2F5",