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 propertie 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.
colorInputColorfalsetheme.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.

Sizes

One of 'small' | 'default' | 'medium' | 'large'

NameTypeValue
smallstringFont size and Icon size: FONT_SIZE.small
Label font size: for material FONT_SIZE.small * 0.78 for default FONT_SIZE.small
defaultstringFont size and Icon size: FONT_SIZE.default
Label font size: for material FONT_SIZE.default * 0.78 for default FONT_SIZE.default
mediumstringFont size and Icon size: FONT_SIZE.medium
Label font size: for material FONT_SIZE.medium * 0.78 for default FONT_SIZE.medium
largestringFFont size and Icon size: FONT_SIZE.large
Label font size: for material FONT_SIZE.large * 0.78 for default FONT_SIZE.large

BorderRadius

One of 'none' | 'small' | 'medium' | 'large' | 'full' | number

NameTypeValue
nonenumber0
smallnumber2
mediumnumber4
largenumber6
fullnumber99999
numberAny number value.

BorderWidth

One of 'none' | 'hairline' | 'thin' | 'base' | 'thick' | number

NameTypeValue
nonenumber0
hairlineStyleSheet.hairlineWidthThis is defined as the width of a thin line on the platform. It can be used as the thickness of a border or division between two elements.
thinnumber1
basenumber2
thicknumber3
numberAny number value

InputColor

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

Name Type ValuePreview
LightDark
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
ColorValueAny ColorValue chosen by developer.