Skip to main content

Text Box

FlexNative Text Box is part of the @flexnative/inputs package. To use the FlexNative Text Box you needs to install @flexnative/inputs package. Fallow this link on how to install the package.

API

import { NumericTextBox } from '@flexnative/inputs';

Component

TextBox

Type: React.PureComponent<TextBoxProps<T>>

Properties

info

TextBoxProps props extends TextInputProps from react-native so any TextInputProps properties from React Native it is applicable also in Text Box of @flexnative/inputs package.

NameTypeRequiredDefault ValueDescription
typeInputTypefalseoutlinedInput type.
sizeSizesfalsedefaultInput Sizes. One of Sizes type.
radiusBorderRadiusfalsemediumInput border radius. One of BorderRadius type
borderWidthBorderWidthfalsenoneOptional input borders width. One of BorderWidth type
borderColorColorValuefalseundefinedInput borders color according react-native ColorValue.
activeBorderColorColorValuefalseundefinedBorder color for active state according react-native ColorValue.
disabledbooleanfalsefalseSet the input as disabled.
colorColorfalsetheme.color.defaultColor by theme or a custom color according react-native ColorValue.
backgroundColorColorValuefalseundefinedInput background color.
activeBorderColorColorValuefalseundefinedBorder color for active state according react-native ColorValue.
materialbooleanfalsefalseIndicator if input should looks like Material input.
helperTextstringfalseundefinedHelper text about input.
labelstringReact.ReactElementfalseundefined
labelStyleStyleProp<TextStyle> or ((state: StateCallbackType) => StyleProp<TextStyle>)falseundefinedEither text styles or a function that receives a boolean reflecting whether the component is currently active and returns text styles.
prefixkeyof IconName or React.ReactElementfalseundefinedA keyof IconName to add icon form @flexnative/icon package, or React.ReactElement to display a custom element as prefix adornments
prefixStyleStyleProp<TextStyle or TextStyle> or ((state: StateCallbackType) => StyleProp<TextStyle>)falseundefinedCustom style for for prefix component. Either view styles or a function that receives a boolean reflecting whether the component is currently active and returns view styles.
prefixSeparatorbooleanfalsefalseIf true a separator border it is show on prefix element.
suffixkeyof IconName or React.ReactElementfalseundefinedA keyof IconName to add icon form @flexnative/icon package, or React.ReactElement to display a custom element as surfix adornments
suffixStyleStyleProp<TextStyle or TextStyle> or ((state: StateCallbackType) => StyleProp<TextStyle>)falseundefinedCustom style for for prefix component. Either view styles or a function that receives a boolean reflecting whether the component is currently active and returns view styles.
suffixSeparatorbooleanfalsefalseIf true a separator border it is show on suffix element.
isErrorbooleanfalsefalseIndicates if the input has an error state.

Color

One of 'default' | 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error' | 'dark' | 'light' | ColorValue

Name Type ValuePreview
LightDark
whiteColorValuetheme.colors.white #FFFFFF #FFFFFF
blackColorValuetheme.colors.black #424242 #424242
backgroundColorValuetheme.colors.background #f8f8f8 #000000
defaultColorValuetheme.colors.default #f5f5f5 #404040
cardColorValuetheme.colors.card #ffffff #232323
textColorValuetheme.colors.text #424242 #ffffff
borderColorValuetheme.colors.border #42424226 #ffffff1A
placeholderColorValuetheme.colors.placeholder #0000001A #FFFFFF1A
infoColorValuetheme.colors.info #3e80ed #3e80ed
successColorValuetheme.colors.success #5ec232 #5ec232
warningColorValuetheme.colors.warning #ffc107 #ffc107
errorColorValuetheme.colors.error #d51923 #d51923
darkColorValuetheme.colors.dark #424242 #424242
secondaryColorValuetheme.colors.secondary #666666 #5C5C5C
lightColorValuetheme.colors.light #ebebeb #ebebeb
primaryColorValuetheme.colors.primary #ff6358 #ff6358
overlayColorValuetheme.colors.overlay #00000021 #FFFFFF21
ColorValueAny ColorValue chosen by developer.