ComponentsPageStandard page

StandardPage

Give a navigation page a title, toolbar and content area.

Example

Requires React 18.2+ or 19 and shared styles. See setup.

Default

Loading preview…

Code
'use client';
import { VStack, Text, NavigationStack } from '@swiftuijs/ui';
import { StandardPage } from '@swiftuijs/ui';
export default function Example() {
    return ((<NavigationStack style={{ height: 420 }}>
      <StandardPage id="page-1">
        <VStack spacing={20}>
          <Text>Page Content</Text>
        </VStack>
      </StandardPage>
    </NavigationStack>));
}

Usage and limitations

  • Provide a unique id and place pages inside a height-bounded NavigationStack. type is page.
  • navigationTitle enables the navigation bar; pushed pages get an automatic back button. Omit the title when composing a custom bar/back guard.
  • toolbarItems accepts actions, including an HStack of buttons. Label icon-only actions and disable Save until the form is valid.
  • Content fills the remaining area. Use ScrollView for long lists, forms, settings or details; keep the scroll container bounded.
  • Form controls use their actual React APIs: TextField accepts onValueChange or an event-based onChange; Toggle accepts isOn and boolean onChange. Provide labels in the surrounding layout or via aria-label.
  • transition configures page animation; noEnteringAnimation skips the entry animation. See NavigationLink transitions for every option and browser fallback.
  • Customize the page with style/className, or theme tokens such as --sw-color-background-primary and --sw-color-separator. See theming.

For a master/detail screen, map data to NavigationLink destinations and give each detail page a stable ID. A settings page can group links and toggles in List/Section; form submission and persistence remain application responsibilities.

More examples

With Navigation Title
With Toolbar Items
Scrollable Content

API reference

PropTypeRequiredDescription
idstringYesUnique, stable page identifier.
type'page'NoThe page type. Must be 'page' for StandardPage component. Default: 'page'
navigationTitlestringNoNavigation bar title. When provided, a navigation bar will be displayed at the top of the page.
toolbarItemsReactNodeNoToolbar items to display on the right side of the navigation bar.
transitionITransitionConfigNoTransition configuration for page animation.
noEnteringAnimationbooleanNoSkip the page entry animation. Default: false

Inherits additional props from IPageBaseComponent.