@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
| Parameter | Type |
|---|---|
props | PropsWithChildren<TabProps> |
Returns
Element
TabProvider()
function TabProvider(__namedParameters): Element;Provides the selected tab value and change handler to tab items.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | PropsWithChildren<TabContextType> |
Returns
Element
Hooks
useTab()
function useTab(): TabContextType;Returns the tab context; must be used within a TabProvider.
Returns
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
| Parameter | Type |
|---|---|
value | string |
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
| Parameter | Type |
|---|---|
value | string |
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