File-name qualifiers: what resolves, in what order
NativeScript resolves foo.xml / foo.css / foo.js against qualified sibling files at runtime. The complete supported qualifier list, ordered by priority (highest wins):
minWH<n>— min of width AND height ≥ n dip (e.g.main.minWH600.xml)minW<n>— min widthminH<n>— min heightland/port— orientationandroid/ios— platform
test.xml
test.android.xml
test.land.xml
test.minWH600.xml
On an Android tablet in portrait with both dimensions ≥ 600, test.minWH600.xml wins — and on any device in landscape, test.land.xml beats test.ios.xml/test.android.xml. Platform is the lowest priority qualifier, which surprises everyone: an orientation variant overrides your platform variant.
The .tablet trap
.tablet / .phone are not qualifiers. No matcher exists for device type, and a file with an unrecognized qualifier isn't even considered a candidate for the base name — page.tablet.xml silently never loads, ever. Use size qualifiers instead:
home.xml → phones
home.minWH600.xml → tablets (the conventional tablet breakpoint)
Rules that bite
minW/minHexplicitly excludeminWHfiles —test.minW600.xmlandtest.minWH600.xmlare distinct candidates; the matcher never confuses them, but you can: aminWHfile is NOT a fallback forminW.- XML, CSS and JS resolve independently.
page.xml+page.land.css+page.ios.jsis legal; each artifact picks its own best variant. This also means a strayfoo.land.csssitting next to afoo.cssyou reference explicitly (cssFile="…/foo.css") silently overrides it in landscape — explicitcssFile/codeFileattribute paths are themselves qualifier-resolved. - Repeated qualifiers in one name: only the last occurrence is scored.
- Custom components resolve the same way inside their folder — a component can ship
MyControl.xml,MyControl.ios.xml,MyControl.minWH600.xml.
Worked example
views/player/
player-page.xml # base
player-page.minWH600.xml # tablet layout
player-page.land.xml # phone landscape (beats platform variants!)
player-page.android.css # Android-only styling
player-page.css # shared styling
If tablet-landscape needs its own layout, that's player-page.minWH600.xml (minWH outranks land); orientation differences within it belong in CSS (.ns-landscape scoping — see ns-root-css-classes).
Verified 2026-08 against @nativescript/core 9.1.0-rc.3: priority order and the .tablet non-qualifier behavior are asserted in apps/automated/src/name-resolvers-tests/qualifier-matcher-tests.ts and implemented in packages/core/module-name-resolver/qualifier-matcher/index.ts (supportedQualifiers list); not re-run standalone.