App Globals
appGlobals is for values that belong to your application logic and that your markup or scripts read through the appGlobals global.
Use it for domain-specific data, labels, feature flags, or constants that your own components and expressions need. Do not use it for XMLUI framework settings or data that should be loaded from a backend.
<Text>{appGlobals.productName}</Text>
<Button enabled="{appGlobals.features.canExport}" label="Export" />Framework and runtime settings belong under xmluiConfig. XMLUI still falls back to old appGlobals values for those settings during the compatibility period, but new apps should put all built-in configuration in xmluiConfig.
Deprecation notice: placing framework / runtime settings under
appGlobalsis still supported today via fallback, but this behaviour will be deprecated in an upcoming minor release. Move built-in settings such asapiUrl,headers,notifications,prefetchedContent,showHeadingAnchors,disableInlineStyle,xsVerbose, and thestrict*family toxmluiConfig.
Examples
Product labels and contact details
{
"name": "Support Portal",
"appGlobals": {
"productName": "Acme Support",
"supportEmail": "support@example.com",
"legalLinks": {
"terms": "https://example.com/terms",
"privacy": "https://example.com/privacy"
}
}
}<Text>{appGlobals.productName}</Text>
<Link to="{'mailto:' + appGlobals.supportEmail}">{appGlobals.supportEmail}</Link>
<Link to="{appGlobals.legalLinks.privacy}">Privacy policy</Link>Application feature flags
{
"appGlobals": {
"features": {
"canExport": true,
"showBetaReports": false
}
}
}<Button when="{appGlobals.features.canExport}" label="Export" />
<ReportsPanel when="{appGlobals.features.showBetaReports}" />Domain constants
{
"appGlobals": {
"orderStatuses": [
{ "id": "new", "label": "New" },
{ "id": "packed", "label": "Packed" },
{ "id": "shipped", "label": "Shipped" }
]
}
}<Select data="{appGlobals.orderStatuses}" optionLabel="label" optionValue="id" />Component authors
Component authors can read raw application globals with useAppGlobals(). Use this only for app-specific values. Use useXmluiConfig() for framework/runtime settings because it returns the merged compatibility view where xmluiConfig overrides legacy appGlobals values.