ExpoStartup

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) => voidCalled when active tab changes
classNamestringAdditional classes for the container
styleViewStyleCustom styles for the container

FormTab Props

PropTypeDefaultDescription
titlestringRequiredThe text displayed in the tab
isActivebooleanWhether the tab is active (handled by FormTabs)
onPress() => voidCalled 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