Skip to main content

LMChatTextInput

LMChatTextInput is a UI component specifically crafted to facilitate message input within a chat interface. It functions as an interactive input box, allowing users to seamlessly compose messages as part of their chat experience.

Props Available

The LMChatTextInput component requires certain props, some of which are mandatory, while others are optional. Here is a breakdown of the available props along with their types:

ParameterTypeDescriptionOptional
inputTextstringRepresents the text to be displayed on the text input
onType(value: string) => voidCallback function called when the text input's text changes
partTypesPartType[]Array of part types✔️
inputRefRef<TextInput>Reference to the text input component✔️
containerStyleStyleProp<ViewStyle>Style for the container of the text input✔️
inputTextStyleTextStyleStyle for the input text✔️
placeholderTextstringText to be displayed before any text is entered✔️
placeholderTextColorstringColor of the placeholder text✔️
autoCapitalize"none" | "sentences" | "words" | "characters"Auto capitalization behavior of the input text✔️
keyboardType"default" | "number-pad" | "decimal-pad" | ...Type of keyboard to be opened✔️
plainTextStyleStyleProp<TextStyle>Style for plain text (not placeholder or input text)✔️
multilineFieldbooleanIndicates if the input text should be multi-lined or not✔️
secureTextbooleanIndicates if the entered text should be hidden (e.g., for passwords)✔️
disabledbooleanIndicates if the text input is editable or not✔️
autoFocusbooleanChecks if the text input should be in focus by default✔️

Code snippet

<LMChatTextInput
placeholderText={} // pass placeholderText here
placeholderTextColor={} // pass placeholderText color here
plainTextStyle={} // pass plain text style color here
style={} // pass styling for input box here
multilineField
inputRef={} // pass input ref for input box here
onType={} // pass callback method
autoFocus={true}
selectionColor={} // pass selection color here
partTypes={[
{
trigger: "@", // text to trigger user list
textStyle: {}, // styling for tagged users name
},
]}
inputText={} // pass input text here
/>