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
idand place pages inside a height-boundedNavigationStack.typeispage. navigationTitleenables the navigation bar; pushed pages get an automatic back button. Omit the title when composing a custom bar/back guard.toolbarItemsaccepts actions, including anHStackof buttons. Label icon-only actions and disable Save until the form is valid.- Content fills the remaining area. Use
ScrollViewfor long lists, forms, settings or details; keep the scroll container bounded. - Form controls use their actual React APIs:
TextFieldacceptsonValueChangeor an event-basedonChange;ToggleacceptsisOnand booleanonChange. Provide labels in the surrounding layout or viaaria-label. transitionconfigures page animation;noEnteringAnimationskips 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-primaryand--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
| Prop | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique, stable page identifier. |
type | 'page' | No | The page type. Must be 'page' for StandardPage component. Default: 'page' |
navigationTitle | string | No | Navigation bar title. When provided, a navigation bar will be displayed at the top of the page. |
toolbarItems | ReactNode | No | Toolbar items to display on the right side of the navigation bar. |
transition | ITransitionConfig | No | Transition configuration for page animation. |
noEnteringAnimation | boolean | No | Skip the page entry animation. Default: false |
Inherits additional props from IPageBaseComponent.