OneScript

navigationTitle

Set the page title and title display mode.

navigationTitle(title) sets the navigation bar title of the page that contains the view, and navigationBarTitleDisplayMode(mode) chooses between a large and an inline title. Both are modifiers you chain onto the modifier of any view on the page.

import { Modifier, Text } from "onescript/views"

<Text modifier={Modifier
  .navigationTitle("Settings")
  .navigationBarTitleDisplayMode("inline")}>
  Content
</Text>
ModifierArgumentDescription
navigationTitlestringThe page title.
navigationBarTitleDisplayMode"automatic" | "inline" | "large"How the title is displayed.

When the root page does not set a title, the project name is used; inside a TabView, the tab's title is used, and navigationTitle("") hides it. When the root view is not a NavigationStack, the title is inline by default. Inside a NavigationStack, the system default applies: the root page shows a large title, and pushed pages with "automatic" inherit the display mode of the previous page.

Note: these modifiers can't be applied to NavigationStack itself; apply them to views inside the stack's pages.

How is this guide?

Last updated on