Skip to main content

LMCreatePostTextInput

The LMCreatePostTextInput component renders a customizable text input field where users can enter the content of their posts.

It also utilizes the LMInputText component for input rendering and allows for custom styling of the input field. The placeholder text, input style, and other settings are configurable based on the current theme and the provided STYLES.

GitHub File:

LMFeedPostContent

Styling Customisations

These styling customisations can be applied by calling the setCreatePostStyles on the STYLES class

PropertyTypeDescription
inputTextStyleanyStyle for the text input field.
placeholderTextstringPlaceholder text shown when input is empty.
placeholderTextColorstringColor of the placeholder text.
rightIconLMButtonPropsProps for the right-side button/icon.
textValueStyleTextStyleStyle for the text value being entered.
mentionTextStyleTextStyleStyle applied to mention text within input.
multilineFieldbooleanWhether the input field supports multiple lines.

To see all the properties, visit CreatePostStyleProps.createPostTextInputStyle


Usage Example

import React, { useEffect } from "react";
import { View } from "react-native";
import {
STYLES,
LMCreatePostTextInput,
CreatePost
} from "@likeminds.community/feed-rn-core";

const CustomCreatePostScreen = () => {
// to customise ui
useEffect(() => {
STYLES.setCreatePostStyles({
createPostTextInputStyle: {
placeholderText: "Create a post",
placeholderTextColor: "pink",
},
});
}, []);

return (
<CreatePost>
<LMCreatePostTextInput />
</CreatePost>
);
};

export default CustomCreatePostScreen;