Skip to main content
Version: 1.x

Toggle Button

The ToggleButton component is a custom toggle button that allows users to select from a list of options.

Import

import { ToggleButton } from '@tra-tech/react-native-kitra';

Usage

import { ToggleButton } from '@tra-tech/react-native-kitra';
import { View } from 'react-native';

const App = () => (
<View style={{ flex: 1, alignItems: 'center' }}>
<ToggleButton
buttons={[
{ label: 'React', onPress: () => null },
{ label: 'Native', onPress: () => null },
{ label: 'Kitra', onPress: () => null },
]}
/>
</View>
);

export default App;

Props

Prop NameData TypeRequiredDescription
buttonsArray<{ label: string,
onPress: (event: boolean) => void,
id?: number }>
YesArray of buttons.
size'small' | 'medium'NoThe size of the button. Default value: 'medium'
themeUIThemeNoThe theme to use for the component.
typographyUITypographyNoThe typography to use for the component.