Components

AppShell provides three key components for rendering micro-frontend applications:

  • AppRenderer - Renders fullpage applications

  • PluginRenderer - Renders plugin applications in designated placeholders

  • ModalRenderer - Renders applications in modal dialogs

AppRenderer

Renders fullpage micro-frontends managed by the AppShell. It dynamically inserts the application's iframe into the DOM based on the provided application ID.

Usage

import { AppRenderer } from '@akinon/app-shell';

const FullPageAppContainer = () => {
  return (
    <div className="fullpage-container">
      <AppRenderer id={1} />
    </div>
  );
};

Props

Prop
Type
Required
Description

id

number

Yes

Unique identifier for the application iframe, application PK may be used

path

string

No

Path to append to the iframe src URL

With Custom Path

How It Works

  1. Retrieve Iframe - Accesses AppShell context to get the iframe reference for the given ID

  2. Insert Iframe - Dynamically inserts the iframe into the container

  3. Style Adjustment - Ensures iframe occupies full container space

PluginRenderer

Renders plugin-type micro-frontends in specific placeholders. Plugins are designed to be embedded within parts of the application without taking over the entire page.

Usage

Props

Prop
Type
Required
Description

placeholderId

string

Yes

ID of the placeholder where the plugin should render

params

ApplicationParams

No

Additional parameters to pass to the plugin

ApplicationParams Type

With Parameters

How It Works

  1. Identify Plugin - Uses placeholderId to find the matching plugin from AppShell context

  2. Match Configuration - Finds the app whose config.placeholder matches the placeholderId

  3. Embed Iframe - Inserts the iframe into the placeholder container

Placeholder Configuration

When registering apps, plugins must specify their placeholder:

ModalRenderer

Renders fullpage application content within a modal dialog. Used for rich modals that need to display micro-frontend content.

circle-info

The uuid is automatically generated by the shell when a client calls showRichModal action. The shell creates the uuid via crypto.randomUUID() and passes it along with path, context, size, and closeIconColor to your modal implementation.

How It Works

  1. Client triggers modal - Client calls actions.showRichModal(path, context, size, closeIconColor)

  2. Shell generates UUID - Shell creates a unique identifier with crypto.randomUUID()

  3. Shell calls your handler - Your showRichModal function receives (uuid, path, context, size, closeIconColor)

  4. Render ModalRenderer - Use the received uuid and path in ModalRenderer

Usage

Props

Prop
Type
Required
Description

uuid

UUID

Yes

Unique identifier generated by shell and passed to your showRichModal handler

path

string

Yes

Path to render content within the modal (relative to client's web_url)

size

ApplicationModalSize

No

Size configuration for the modal (defaults to 540x360px)

circle-exclamation

ApplicationModalSize Type

With Size Configuration

Complete Example

Here's how all three components work together in a shell application:

Styling Considerations

All renderer components insert iframes that fill their container. Ensure the container has appropriate dimensions:

Last updated

Was this helpful?