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:
Parameter | Type | Description | Optional |
---|---|---|---|
inputText | string | Represents the text to be displayed on the text input | |
onType | (value: string) => void | Callback function called when the text input's text changes | |
partTypes | PartType[] | Array of part types | ✔️ |
inputRef | Ref<TextInput> | Reference to the text input component | ✔️ |
containerStyle | StyleProp<ViewStyle> | Style for the container of the text input | ✔️ |
inputTextStyle | TextStyle | Style for the input text | ✔️ |
placeholderText | string | Text to be displayed before any text is entered | ✔️ |
placeholderTextColor | string | Color 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 | ✔️ |
plainTextStyle | StyleProp<TextStyle> | Style for plain text (not placeholder or input text) | ✔️ |
multilineField | boolean | Indicates if the input text should be multi-lined or not | ✔️ |
secureText | boolean | Indicates if the entered text should be hidden (e.g., for passwords) | ✔️ |
disabled | boolean | Indicates if the text input is editable or not | ✔️ |
autoFocus | boolean | Checks 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
/>