1.0.5 • Published 2 years ago

rn-customizable-radio-button v1.0.5

Weekly downloads
7
License
ISC
Repository
github
Last release
2 years ago

rn-customizable-radio-button

One can customize the radio buttons using custom color, button styles, orientation or button positions. The developer has full control to customize all the properties of the radio buttons.

Setup

npm i rn-customizable-radio-button

Usages

import { RadioButton } from 'rn-customizable-radio-button';

<RadioButton selectedIndex={selectedIndex} onPress={(item, index) => { setSelectedIndex(index); }} items={itemList} orientation={'center-horizontal'} textStyle={styles.textStyleRadio} />

Properties

PropTypedefaultRequiredNote
itemsArrayNARequiredThe Array of the items or check checklist with key-value pair
selectedIndexStringEmpty StringRequiredThe key of the selected item
onPressFunctionNARequiredFunction Called onpress of the radio button
orientationStringcenter-horizontalOptionalOrientation of the Radio Button View, can be set to vertical or center-horizontal
buttonPositionStringleftOptionalPosition of the radio button with respect to the text, can be set to right or left
selectedButtonStyleObjectNAOptionalstyles for the selected radio button
buttonStyleObjectNAOptionalstyles for all radio buttonsof the array
textStyleObjectNAOptionalstyles for radio button label
styleObjectNAOptionalpass the style object
containerStyleObjectNAOptionalstyles for radio containers
errorMessageStringNAOptionalPass the error Message you want to show
errorTextStyleObjectNAOptionalPass the style object for the error Message

Screenshot

ScreenShot