Luigi Container is a web component that can be used to render a Luigi micro frontend without the need of a Luigi Core application. Luigi Container can work with any framework that supports HTML. It can be an easy solution for integrating micro frontends inside already existing apps without the cost of refactoring. You can also have multiple micro frontends on the same page.
@luigi-project/container
npm install @luigi-project/container
import '@luigi-project/container';
{
...some other settings,
"html.customData": [
"PATH/TO/node_modules/@luigi-project/container/vscode.html-custom-data.json"
]
}
After importing the package, you can use the Luigi container anywhere in your application. You can configure it just like a regular Luigi application, for example by using parameters such as viewURL (which specifies the URL of the micro frontend):
<luigi-container
viewURL="https://www.example-microfronted.com"
webcomponent="false"
label="my label"
context='{"label": "Calendar"}'>
</luigi-container>
The Luigi compound Container works similarly to Luigi's compound web components feature and allows you to insert multiple micro frontends on the same page.
You can use the Luigi compound Container as follows:
<luigi-compound-container
context='{"label": "Dashboard"}'
compoundConfig = { your config here }>
</luigi-compound-container>
git clone git@github.com:SAP/luigi.git
cd luigi/container
npm install
npm run build
npm run start-examples
The app should be available at http://localhost:8080
in your browser.
To make use of all of the container based Luigi functionalities you can take a further look at the API reference:
You can follow the Luigi Container UI5 tutorial to learn how to: