@ovok/native/tab

Tab bar component, provider, context and hook.

  • Stable unknown
  • Release candidate since 1.16.1-rc.3
  • Development since 1.16.1-dev.2111+9796905

Tab bar component, provider, context and hook.

Import from @ovok/native/tab.

Components

Tab()

function Tab(props): Element;

Row of tab items; value selects the active item.

Parameters

ParameterType
propsPropsWithChildren<TabProps>

Returns

Element


TabProvider()

function TabProvider(__namedParameters): Element;

Provides the selected tab value and change handler to tab items.

Parameters

ParameterType
__namedParametersPropsWithChildren<TabContextType>

Returns

Element

Hooks

useTab()

function useTab(): TabContextType;

Returns the tab context; must be used within a TabProvider.

Returns

TabContextType

Type Aliases

TabContextType

type TabContextType = object;

Value of the tab context.

Properties

onChange
onChange: (value) => void;

Selects the tab item with the given value.

Parameters
ParameterType
valuestring
Returns

void

value
value: string;

Value of the selected tab item.


TabProps

type TabProps = object;

Props for Tab.

Properties

onChange
onChange: (value) => void;

Called with the value of the tab item the user selects.

Parameters
ParameterType
valuestring
Returns

void

style?
style?: StyleProp<ViewStyle>;

Style for the tab row.

testID?
testID?: string;

Test identifier.

value
value: string;

Value of the selected tab item.

Variables

TabContext

const TabContext: Context<TabContextType | null>;

Context holding the selected tab value and its setter.

Last updated on

On this page