Skip to content

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 ​

  1. Boot (admin/app.ts): Mounts the root <app-root> component inside a shadow root, converts Tailwind/daisyUI rem units to px at 16px (isolating from the host LIMS page's 10px root font-size), and registers lazy page loaders via:
    ts
    views: import.meta.glob("/admin/Modules/**/UI/Views/**/*.component.ts")
  2. Root component (admin/app.component.ts): Renders <fusion-toast />, <div data-theme="labmin">, and <fusion-router />, and watches router.error() to display failed navigation errors as toasts.
  3. View resolution: When a controller returns Fusion::render('OrderList/OrderList.component.ts', $props), PHP resolves the path against the caller's nearest module or submodule UI/Views/ folder and sends the component path + JSON props.
  4. 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, and input<T>(default) for optional ones.
  • TypeScript prop types: Define all prop interfaces in UI/Components/<module>.types.ts and keep them in sync with your PHP DTOs.
  • Deferred props: Return Fusion::defer(fn () => ...) from PHP for slow data; check isDeferredLoading('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].
Link typeHow to write itWhy
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 navigationawait navigate(url(...)) or getAction('view', { id })Returns true when the next page rendered; leaves current page intact on HttpException.
Another LIMS modulePlain <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.

Labmin LIMS Module Developer Documentation