Skip to main content

TabControl

The TabControl component in our library is a versatile navigational element used to organize and present multiple views or sections within an application. It typically appears as a set of tabs arranged horizontally or vertically, with each tab representing a distinct content area or feature. Users can switch between tabs to access different parts of the application quickly and intuitively. TabControls are commonly used in applications with complex navigation structures, such as settings screens, multi-step processes, or content-rich interfaces.

Usage

Basic usage

import {TabControl} from 'rn-inkpad';

import {FormUser, Users} from './components';

const App = () => {
const values = [
{key: 'Add user', renderItem: FormUser},
{key: 'Users', renderItem: Users},
];

return <TabControl values={values} />;
};

Properties

PropDescriptionTypeRequiredDefault
valuesKey and renderItem array to generate each tab.{key: string; renderItem: JSX.Element}[]YesNone
labelThe label with which you want to identify the tabControl.stringNoNone
labelStyleStyles for label.StyleProp<TextStyle>NoNone
selectedIndexSelected initial value.numberNo0
backgroundTabColorTabControl background color.stringNo'#CCCCCC'
tabTintColorTint color for the selected tab.stringNo'#FFFFFF'
textColorText color in the TabControl.stringNo'#000000'
selectedTextColorText color en the selected tab.stringNo'#000000'
containerStyleStyles for the rendered component.StyleProp<ViewStyle>NoNone
styleStyles for the component container.StyleProp<ViewStyle>NoNone

Example