Skip to main content

MaskedTextInput

MaskedTextInputs are used for inputting text with a mask.

Import

import { MaskedTextInput } from '@nomada-sh/react-native-eyecandy';

Props

MaskInput Props

Inherits MaskInput Props.

style

These styles will be applied to the input container view.

Type
View Style

styles

Type
object

Properties

NameTypeRequiredDescription
containerView StyleNoThese styles will be applied to the input container view.
inputText StyleNoThese styles will be applied to the input view.
iconContainerView StyleNoThese styles will be applied to the icon container view.
leftIconContainerView StyleNoThese styles will be applied to the left icon container view.
rightIconContainerView StyleNoThese styles will be applied to the right icon container view.

fullWidth

If set to true, the input will expand to fill the width of its parent.

TypeDefault
booleantrue

color

This defines the theme colors of the input. The colors will change based on the theme (dark or light) if set to 'default'.

TypeDefault
'default' or 'error''default'

error

If true, the input will be in an error state.

TypeDefault
booleanfalse

height

This defines the height of the input.

TypeDefault
number56

iconLeft

Renders an icon on the left side of the input.

Type
Icon

onPressIconLeft

() => void;

Callback function that is called when the left icon is pressed.

Type
function

focusOnLeftIconPress

If true, the input will be focused when the left icon is pressed.

TypeDefault
booleantrue

iconRight

Render an icon on the right side of the input.

Type
Icon

onPressIconRight

() => void;

Callback function that is called when the right icon is pressed.

Type
function

focusOnRightIconPress

If true, the input will be focused when the right icon is pressed.

TypeDefault
booleanfalse

inputLeft

Renders any React Node on the left side of the input (after iconLeft).

Type
node

inputRight

Renders any React Node on the right side of the input (before iconRight).

Type
node

required

If true, adds an asterisk to end of the input placeholder.

TypeDefault
booleanfalse

inputPaddingLeft

Left input padding, overrides the default padding.

Type
number

inputPaddingRight

Right input padding, overrides the default padding.

Type
number

inputDefaultHorizontalPadding

Default horizontal input padding used when no icons are present.

TypeDefault
number16

marginTop

Top margin applied to the input container view.

Type
number

marginBottom

Bottom margin applied to the input container view.

Type
number

showSecureTextEntryToggle

If true, a toggle button will be rendered on the right side of the input (after rightIcon). Used to toggle between secure and non-secure text entry.

TypeDefault
booleanfalse

secureTextEntry

If true, the input will be in secure text entry mode.

TypeDefault
booleanfalse

onSecureTextEntryChange

(secureTextEntry: boolean) => void;

Callback function that is called when the secure text entry toggle icon is pressed.

Type
function