Home

Awesome

react-native-paper-form-components

NPM version NPM downloads

A set of highly customizable form components for React Native Paper

Requirements

node ^20.13.1

Installation

npm install react-native-paper-form-components
yarn add react-native-paper-form-components

Usage

import {Select, Button, Input, Checkbox, RadioButton} from 'react-native-paper-form-components'

Props

Select

PropertyTypeRequiredDescription
valuestring | string[]YesThe selected value(s).
onChangefunctionYesCallback function to handle value change.
optionsOptionType[]YesList of options to select from.
buttonBgColorstringYesBackground color of the button.
labelstringNoLabel for the select component.
optionLabelstringNoKey for the label in the options.
optionValuestringNoKey for the value in the options.
searchPlaceholderstringNoPlaceholder text for the search bar.
modalBgColorstringNoBackground color of the modal.
buttonLabelstringNoLabel text for the button.
placeholderstringNoPlaceholder text for the select button.
labelStyleStyleProp<TextStyle>NoStyle for the label.
isSearchablebooleanNoIndicates if the options are searchable.
noResultFoundTextstringNoText to display when no search results are found.
searchBarStyleStyleProp<TextStyle>NoStyle for the search bar.
searchBarInputStyleStyleProp<TextStyle>NoStyle for the search bar input.
searchResultLabelStyleStyleProp<TextStyle>NoStyle for the search result labels.
modalStyleStyleProp<ViewStyle>NoStyle for the modal.
modalDismissablebooleanNoIndicates if the modal can be dismissed by clicking outside.
buttonIconstringNoIcon for the button.
buttonStyleViewStyleNoStyle for the button.
buttonLabelStyleStyleProp<TextStyle>NoStyle for the button label.
buttonHeightnumberNoHeight of the button.
buttonModeButtonModeNoMode of the button (contained, outlined, text).
buttonIconColorstringNoColor of the button icon.
buttonIconSizenumberNoSize of the button icon.
buttonIconPosition'left' | 'right'NoPosition of the button icon.
buttonRoundednumberNoBorder radius of the button.
isMultiselectbooleanNoIndicates if multiple options can be selected.
checkedColorstringNoColor of the checkbox when checked.
uncheckedColorstringNoColor of the checkbox when unchecked.
disabledbooleanNoIndicates if the component is disabled.

Button

Here's the updated table with the additional labelColor and compact properties:

PropertyTypeRequiredDescription
labelstring | React.ReactNodeYesThe label text or component for the button.
onPress() => voidYesCallback function to handle button press events.
iconstringNoIcon to display in the button.
styleViewStyleNoStyle for the button container.
labelStyleStyleProp<TextStyle>NoStyle for the button label text.
bgColorstringYesBackground color of the button.
labelColorstringYesColor of the button label text.
heightnumberNoHeight of the button.
modeButtonModeNoMode of the button (contained, outlined, text).
iconColorstringNoColor of the button icon.
iconSizenumberNoSize of the button icon.
iconPosition'left' | 'right'NoPosition of the button icon.
roundednumberNoBorder radius of the button.
uppercasebooleanNoIndicates if the button label should be uppercase.
disabledbooleanNoIndicates if the button is disabled.
compactbooleanNoIndicates if the button should be compact.

Input

PropertyTypeRequiredDescription
labelstringYesThe label text for the input.
valuestringYesThe current value of the input.
placeholderstringNoPlaceholder text for the input.
onChangeText(value: any) => voidYesCallback function to handle text changes.
typeInputTypeYesType of the input.
bgColorstringNoBackground color of the input.
outlineColorstringNoOutline color of the input when in outlined mode.
styleViewStyleNoStyle for the input container.
contentStyleStyleProp<TextStyle>NoStyle for the content inside the input container.
outlineStyleStyleProp<ViewStyle>NoStyle for the outline of the input.
onLeftIconPress() => voidNoCallback function for pressing the left icon.
onRightIconPress() => voidNoCallback function for pressing the right icon.
leftIconstringNoIcon to display on the left side of the input.
rightIconstringNoIcon to display on the right side of the input.
iconColorstringNoColor of the input icon.
iconSizenumberNoSize of the input icon.
labelStyleStyleProp<TextStyle>NoStyle for the input label.
roundednumberNoBorder radius of the input.
heightnumberNoHeight of the input.
mode'flat' | 'outlined'NoMode of the input (flat or outlined).
disabledbooleanNoIndicates if the input is disabled.

Checkbox

PropertyTypeRequiredDescription
labelstringYesThe label text for the checkbox.
checkedbooleanYesIndicates if the checkbox is checked.
setCheckedfunctionYesCallback function to handle checkbox state change.
checkedColorstringNoColor of the checkbox when checked.
uncheckedColorstringNoColor of the checkbox when unchecked.
styleViewStyleNoStyle for the checkbox container.
labelStyleStyleProp<TextStyle>NoStyle for the checkbox label text.
disabledbooleanNoIndicates if the checkbox is disabled.
mode'android' | 'ios'NoMode of the checkbox (specific styles for Android or iOS).

RadioButton

PropertyTypeRequiredDescription
valuestringYesThe selected value.
onChangefunctionYesCallback function to handle value change.
optionsOptionType[]YesList of options to select from.
optionLabelstringNoKey for the label in the options.
optionValuestringNoKey for the value in the options.
labelstringNoLabel for the radio button group.
checkedColorstringNoColor of the radio button when checked.
uncheckedColorstringNoColor of the radio button when unchecked.
styleViewStyleNoStyle for the radio button container.
labelStyleStyleProp<TextStyle>NoStyle for the radio button group label.
radioButtonLabelStyleStyleProp<TextStyle>NoStyle for the radio button labels.
disabledbooleanNoIndicates if the radio button group is disabled.

License

The MIT License (MIT). Please see License File for more information.

Changelog

Please see CHANGELOG for more information what has changed recently.