Appearance
Fusion & Angular UI
How modern LIMS module UIs render Angular components inside a shadow root using labmin/fusion, @labmin/fusion-angular, and @labmin/fusion-angular-ui.
How Fusion bridges PHP & Angular
- Boot (
admin/app.ts): Mounts the root<app-root>component inside a shadow root, converts Tailwind/daisyUIremunits topxat 16px (isolating from the host LIMS page's10pxroot font-size), and registers lazy page loaders via:tsviews: import.meta.glob("/admin/Modules/**/UI/Views/**/*.component.ts") - Root component (
admin/app.component.ts): Renders<fusion-toast />,<div data-theme="labmin">, and<fusion-router />, and watchesrouter.error()to display failed navigation errors as toasts. - View resolution: When a controller returns
Fusion::render('OrderList/OrderList.component.ts', $props), PHP resolves the path against the caller's nearest module or submoduleUI/Views/folder and sends the component path + JSON props. - Shadow root isolation: Legacy Bootstrap 3 CSS from the LIMS shell cannot break your Angular components, and Tailwind 4 / daisyUI styles never leak into legacy pages.
Anatomy of a Fusion page
Every page lives in UI/Views/<Name>/<Name>.component.ts as a standalone Angular component whose signal input() properties match the keys returned by Fusion::render():
ts
import { Component, input } from "@angular/core";
import { FusionLink, isDeferredLoading, url } from "@labmin/fusion-angular";
import { Button, TableModule } from "@labmin/fusion-angular-ui";
import type { Order } from "../../Components/orders.types";
@Component({
selector: "orders-list",
imports: [Button, FusionLink, TableModule],
template: `
<fusion-table [value]="orders()" stripedRows size="small">
<ng-template #header>
<tr><th>Order</th><th></th></tr>
</ng-template>
<ng-template #body let-row>
<tr>
<td>{{ row.title }}</td>
<td class="text-right">
<a fusionButton fusionLink class="btn-sm btn-info font-normal" [href]="viewUrl(row.id)">
View
</a>
</td>
</tr>
</ng-template>
</fusion-table>
`,
})
export class OrderList {
readonly orders = input<Order[]>([]);
readonly canCreate = input(false);
protected viewUrl(id: number): string {
return url("view", { feature: "orders", query: { id } });
}
}Key frontend rules
- Signal inputs: Use
input.required<T>()for props the page cannot render without, andinput<T>(default)for optional ones. - TypeScript prop types: Define all prop interfaces in
UI/Components/<module>.types.tsand keep them in sync with your PHP DTOs. - Deferred props: Return
Fusion::defer(fn () => ...)from PHP for slow data; checkisDeferredLoading('propName')in Angular while it loads. - Split large pages: Break tabs, panels, and dialogs into focused child components inside
UI/Components/rather than building multi-thousand-line views. - XSS safety: Rely on Angular's
interpolation. Never bind user-supplied text to[innerHTML].
Navigation & links
| Link type | How to write it | Why |
|---|---|---|
In-module page (?feature=...) | <a fusionLink [href]="url('view', { feature: 'orders', query: { id } })"> | Plain clicks navigate via Fusion (no full reload); Ctrl/Cmd-click still opens a new tab. |
| Programmatic navigation | await navigate(url(...)) or getAction('view', { id }) | Returns true when the next page rendered; leaves current page intact on HttpException. |
| Another LIMS module | Plain <a [href]="..."> (no fusionLink) | External modules may not be Fusion pages and need a full browser load. |
| File download | <a [href]="url('download', { ..., query: { id, raw: '1' } })" download> | raw=1 bypasses the LIMS HTML shell; download prevents the shell's "Loading" overlay from sticking. |
UI component library (@labmin/fusion-angular-ui)
Use @labmin/fusion-angular-ui (^0.6.2) for standard LIMS-styled components (Breadcrumb, Tabs, TableModule, FilterBar, Dialog, ConfirmDialog + ConfirmationService, Message, Menu, ContextMenu, Tooltip, Select, DatePicker, FileUpload, InputText, Textarea, Button, toastStore) paired with @lucide/angular icons and Tailwind 4 + daisyUI (labmin theme in admin/app.css).
See the full @labmin/fusion-angular-ui API Reference and LIMS Design Language.
Next: learn how permissions and runtime toggles work in Access Control & Feature Flags.