External Components

Use components from other apps (attachment uploader, activity log, etc.) using ComponentRenderer.


ComponentRenderer

Dynamically load and render components from other apps.

Basic Usage

import { ComponentRenderer } from "uxp/components";

const LocationDetails = ({ locationKey }) => {
    return (
        <div>
            <h1>Location Details</h1>

            {/* Load activity log from System app */}
            <ComponentRenderer
                moduleId="iviva-system-app"
                componentId="activity-log"
                type="ui"
                additionalProps={{
                    objectType: 'Location',
                    objectKey: locationKey
                }}
            />
        </div>
    );
};

Common External Components

1. Activity Log (Timeline)

2. Attachment Uploader

3. Comments Component


Finding External Components

To find available external components:

  1. Check the app's module registration

  2. Look for window.registerUI() calls

  3. Note the moduleId and componentId

Example from System app:


Props Passing

Pass props using additionalProps:


Type: Widget vs UI

  • type="widget" - For dashboard widgets (registered with window.registerWidget())

  • type="ui" - For UI components (registered with window.registerUI())


Loading States

ComponentRenderer handles loading automatically. Component will show loading state while scripts are loaded.


Error Handling

If component not found, ComponentRenderer shows error message. Ensure:

  1. moduleId is correct

  2. componentId is correct

  3. App is enabled in Lucy

  4. Component is registered


Example: Details Panel with External Components


See Location 5.0 app (/apps/iviva.dx/Location/5.0/Resources/views/src/) for complete examples of using external components.


Next Steps

Last updated