Tabs

Tabbed navigation (SwiftUI TabView with Tab). Each Trigger declares a tab; the Content with the same value is its page.

Declaration

React
import { Tabs } from 'swiftui-react-native';

Parts

Compose these together. Each part renders as part of one SwiftUI view.

React
<Tabs.Root
  value?: string
  defaultValue?: string
  onValueChange?: (value: string) => void
>
  children?: ReactNode
</Tabs.Root>
  • valuestring

    The selected tab (controlled).

  • defaultValuestring

    The initially selected tab (uncontrolled).

  • onValueChange(value: string) => void

    Called when the user selects a tab.

  • childrenReactNode

Also takes the common view props: modifiers, style and testID.

Relationships

SwiftUI declarations

Swift
nonisolated init<C>(
    selection: Binding<SelectionValue>,
    @TabContentBuilder<SelectionValue> content: () -> C
)
where Content == TabContentBuilder<SelectionValue>.Content<C>, C : TabContent
Swift
nonisolated init<S>(
    _ title: S,
    systemImage: String,
    value: Value,
    @ContentBuilder content: () -> Content
)
where Label == DefaultTabLabel, S : StringProtocol
Swift
nonisolated func tabItem<V>(
    @ContentBuilder _ label: () -> V
) -> some View
where V : View
Swift
@export(implementation) nonisolated func tag<V>(
    _ tag: V,
    includeOptional: Bool = true
) -> some View
where V : Hashable

See also

More in Navigation.