These docs cover qiankun 3.0 (RC) — install it with npm i qiankun@rc. For 2.x, see the v2 docs.
Skip to content

qiankun · micro-frontend runtimeShip independently. Compose on demand.

Use loadMicroApp to mount front-end apps from different teams and frameworks wherever your product needs them. Each app keeps its own development and release cadence.

A host application composing independently delivered micro-apps at runtime

Control one micro-app instance

Install qiankun in the main app:

bash
npm install qiankun@rc

v3 installs from the rc tag

qiankun 3.0 is a release candidate, so npm's latest tag still resolves to 2.x. Ask for @rc explicitly to get v3.

Mount after the container exists, then keep the returned handle for status and teardown:

ts
import { loadMicroApp } from 'qiankun';

const container = document.getElementById('micro-app-slot');
if (!container) throw new Error('micro-app-slot not found');

const microApp = loadMicroApp({
  name: 'orders',
  entry: '//localhost:7101',
  container,
});

await microApp.mountPromise;

// When this part of the page is removed:
await microApp.unmount();

The micro-app exports bootstrap, mount, and unmount; qiankun loads it into the HTMLElement and drives those lifecycles. Follow Getting started for a complete runnable setup.

For applications whose lifetime should be driven entirely by the URL, see the route-based registerMicroApps and start alternative.

A live version of the repository's example apps — two hosts driving the same set of micro-apps — runs at examples.qiankunjs.com.

Released under the MIT License.