Skip to content

Add a tab bar

A tab bar gives your app the bottom navigation most iPhone apps have. Each tab opens one route.

In .ynch/navigation.json, add a tabBar beside routes:

{
"schemaVersion": "1.0.0",
"initialRoute": "home",
"routes": [
{ "id": "home", "screenId": "home", "label": "Home", "parameters": {} },
{ "id": "about", "screenId": "about", "label": "About", "parameters": {} }
],
"tabBar": {
"items": [
{ "routeId": "home", "label": "Home", "icon": "home" },
{ "routeId": "about", "label": "About", "icon": "activity" }
]
}
}

The rules:

  • Two to five tabs.
  • Each tab points at a different route, and that route takes no parameters.
  • The initialRoute must be one of the tabs.
  • icon is one of the built-in icons.

Selecting a tab opens its screen with nothing to go back to. Screens you open from there stay inside the tab.

Three optional settings, each from a fixed list:

Setting Values Default
style floating (a rounded bar inset from the edges) or full-width (edge to edge, attached to the bottom) floating
material solid (your theme’s surface color) or glass solid
labels shown or hidden (icons only) shown
"tabBar": {
"items": [ ... ],
"style": "full-width",
"material": "glass"
}

glass is Liquid Glass on iOS 26 and later. On earlier versions it is drawn as a blurred, translucent bar.

The selected tab uses your theme’s primary color and the others use muted. With labels hidden, the label is still what VoiceOver reads.

Terminal window
npx ynch check
npx ynch upload

The look options need a current version of the Ynch app on your iPhone. An older version shows the default bar.