NativeTemplates

FormTabs

A tab navigation component for forms and content sections

FormTabs

A component for creating tab-based navigation between different form sections or content areas.

Import

import FormTabs, { FormTab } from '@/components/forms/FormTabs';

Props

FormTabs Props

PropTypeDefaultDescription
childrenReactElement<FormTabProps>[]RequiredFormTab components to render as tabs
defaultActiveTabstringFirst tab's titleThe initially active tab
onChange(tab: string) => void—Called when active tab changes
classNamestring—Additional classes for the container
styleViewStyle—Custom styles for the container

FormTab Props

PropTypeDefaultDescription
titlestringRequiredThe text displayed in the tab
isActiveboolean—Whether the tab is active (handled by FormTabs)
onPress() => void—Called when tab is pressed (handled by FormTabs)

Basic Usage

<FormTabs onChange={(tab) => console.log(`Switched to ${tab}`)}>
  <FormTab title="Personal" />
  <FormTab title="Address" />
  <FormTab title="Payment" />
</FormTabs>

With Default Tab

<FormTabs defaultActiveTab="Address">
  <FormTab title="Personal" />
  <FormTab title="Address" />
  <FormTab title="Payment" />
</FormTabs>

With Custom Styling

<FormTabs 
  className="my-4"
  style={{ maxWidth: 300 }}
>
  <FormTab title="Login" />
  <FormTab title="Signup" />
</FormTabs>

On this page