A worked example: a complete admin application built from @xui/* packages and nothing else.
nx serve admin # dev server
nx build admin # production build to dist/apps/admin
nx test admin # the pure logic — metrics and formatting
nx lint adminAny email and password sign you in; there is no authentication behind the guard. The data is generated from a fixed seed, so every reload shows the same figures.
| Page | Worth looking at |
|---|---|
| Dashboard | Statistics with period-over-period change, two ECharts charts, a timeline, skeleton states |
| Customers | Filter/sort/paginate over one signal, detail drawer, destructive delete with undo |
| Orders | 5,000 rows in a virtualised xui-data-table with a custom cell template |
| Products | Card grid with sparklines; restocking updates the sidebar badge |
| Settings | Tabbed forms, switches, a theme radio bound to the same signal as the header toggle |
| Sign in | The one route outside the shell, plus the guard and the redirect back |
The shell adds a ⌘K command palette (every destination plus every customer, from one navigation
model), a ? shortcuts dialog generated by @xui/hotkeys, toasts, and a mobile drawer that shares
its component with the desktop rail.
Everything derives. DataStore holds four signals; the pages hold computed() over them. Deleting
a customer updates one signal, and the table, the sidebar badge and the page summary all follow —
there is no refresh path, no subscription and no ngOnChanges anywhere in the app.
metrics.ts is where that pays off twice: it is plain functions over an array, so the dashboard's
figures are unit-tested without a TestBed, a fixture or a component.
Both should disappear once the underlying packages change; the code says so at each site.
app-fieldinstead ofxui-form-fieldfor a select, a textarea or a radio group.xui-form-fieldthrowsmust contain an XFormFieldControlduring change detection unless it finds that token, and only@xui/inputprovides it. The throw takes down the whole view — it is what blanked the settings tabs while this was being built. Seeshell/field.ts.- No
g d-style navigation shortcuts.XuiHotkey.combodocuments sequences (g his in its own examples) butparseXComboonly splits on+, so a sequence parses as one key named"g d"and never matches. It would fail silently while still appearing in the generated help dialog.
Two things bite on a phone and are fixed in the templates rather than worked around in CSS:
- Grid and flex items need
min-w-0. A track is min-content-sized by default, so one wide child — a table whose columns are deliberately fixed-width — widens the track and pushes the page sideways. - Strips that cannot shrink (a six-option segmented control, a four-label tab list) get their own
overflow-x-autoso the strip scrolls instead of the page.