- Properties - Send reactive data from the host app to the embedded app to update its state (e.g., pass search terms or selected filters, set dark or light mode)
- Events - Trigger actions bidirectionally from events in the host app or embedded app (e.g. scroll page of host app when button in embedded app is clicked, sync the URL path anytime page navigation happens in either the host or embedded app)
Properties - Pass data from host to embed
Send data to your embedded app to customize what users see based on properties of the host application. Properties are reactive—when they change in the host app, the embedded app automatically receives the updated values. Follow the steps below to get started working with properties.Set properties in host app
In the host app, add logic for setting properties and passing them to the embed component. For example, here the host app sets a
searchQuery property to customize what the embed displays, along with theme property to toggle dark/light mode.View code example
View code example
Prompt Clark to use properties in embedded app
Once you’ve set up properties in your host app, prompt Clark to use them in your Superblocks app. For example:
This app will be embedded - Add support to accept aIn the underlying code, Clark will importsearchQueryproperty from the host app to filter the table, along with athemeproperty for toggling dark/light mode.
useEmbedProperties to read the specified properties and use them in the component logic (filtering, theming, etc.).View code example
View code example
Events - Two-way communication
Use events for bidirectional communication between the host app and embedded Superblocks app.| Direction | Description | Examples |
|---|---|---|
| Embed → Host | Notify the host application when something happens inside the embedded Superblocks app | • Notify the host when a user selects a row in a table • Report errors or validation failures to the host • Trigger navigation in the host app based on embed actions |
| Host → Embed | Trigger actions inside the embedded Superblocks app from your host application | • Trigger a data refresh when the user clicks a button in the host app • Navigate to a specific view or record in the embedded app • Open a modal or form in the embedded app |
Embed → Host
Add event listener in host app
Superblocks apps emit the following built-in events, which host apps can listen for:
To respond to these events, register the relevant callback handler above in your host app’s embed component.
For any custom events emitted by your Superblocks app (see step 2), use the
| Event Name | Handler | Description |
|---|---|---|
AppLoadedEvent | onAppLoaded | Triggered when the application finishes loading and becomes interactive. |
AuthErrorEvent | onAuthError | Triggered when the user’s session expires or upon login if there is an authentication error. Will also trigger if the user clicks on a link that tries to bring them to a Superblocks Application they’re not allowed to access. |
NavigationEvent | onNavigation | Triggered on cross application navigation events. |
View built-in event example
View built-in event example
onEvent handler to listen and respond to these in your host app. Note, the eventName parameter is the name of the event emitted from Superblocks.View custom event example
View custom event example
Prompt Clark to emit custom events
For built-in events (
AppLoadedEvent, AuthErrorEvent, NavigationEvent), no additional prompting is needed—your app emits these automatically.For custom events, prompt Clark to emit events for any actions in your app. For example:- “Emit an orderSelected event when a user clicks a table row”
- “Send a formSubmitted event to the host when the form is saved”
- “Notify the host with an error event if the API call fails”
useEmitEmbedEvent to call the emit function at the appropriate trigger point and include relevant payload data.View code example
View code example
Host → Embed
Emit event from host app
Use a ref to access the embed component and call
emit() to send events to your Superblocks app.View code example
View code example
Prompt Clark to listen for host events
Prompt Clark to add event listeners for any events you emit from the host app. For example:
- “Listen for a refreshData event from the host and refetch the API”
- “When the host triggers selectOrder, highlight that row in the table”
- “Add a listener for navigate_to events to handle host-driven navigation”
useEmbedEvent, register an event handler, and implement the action (refetch, select, navigate, etc.).View code example
View code example
Working with embedded apps in the Superblocks editor
Since embedded apps often rely on host app information like properties, events, and logged-in user metadata, it can be helpful to simulate these in the Superblocks editor to review the app’s look and functionality independent of embedding. You can do this by prompting Clark to create a testing interface in the Superblocks editor—Clark is aware of the three modes of a Superblocks app (EDIT, PREVIEW, and PUBLISHED), so it is capable of writing conditional logic to show different components or execute different logic based on the mode of the app. For example:Since this app is going to be embedded, I’d like to set up a way to simulate certain functionality directly in the Superblocks editor as follows:
In EDIT mode:
- Show a dropdown that allows me to select / assume a role (agent or manager) to be used in the backend API
- Add a switch for toggling light / dark mode
In PREVIEW and PUBLISHED modes:
- Don’t show the dropdown—instead, get the role based on the logged-in user’s
metadata.role.- Dont show the toggle—instead get the mode based on a
themeproperty passed from the host app

