Text Props
The text prop group contains all properties related to text content, including labels, placeholders, values, and text styling options.
Properties
| Prop | Type | Default | Description |
|---|---|---|---|
| placeholderText | string | undefined | Placeholder text for the input field |
| placeholderTextColor | string | #A0A0A0 | Color of the placeholder text |
| inputTextColor | string | #000000 | Color of the input text |
| labelText | string | undefined | Text for the label |
| labelTextColor | string | #000000 | Color of the label text |
| requiredText | string | * | Text to display instead of '*' when the input is required |
| errorText | string | undefined | Text to display below input when there is an error |
| value | string | undefined | Value of the input field |
| hideLabel | boolean | false | Boolean to hide the label |
| characterLimit | number | undefined | Maximum number of characters allowed in the input |
| showCharacterLimit | boolean | false | Boolean to show the character limit below input field |
Example
tsx
import { FormInput } from '@react-native-utils/forminput';
// Using the text prop group
const TextPropsExample = () => (
<FormInput
text={{
labelText: "Full Name",
placeholderText: "Enter your full name",
placeholderTextColor: "#999",
inputTextColor: "#333",
value: "John Doe",
characterLimit: 50,
showCharacterLimit: true,
errorText: "Name is required!"
}}
/>
);Notes
- Use
characterLimitwithshowCharacterLimitto provide visual feedback on character count - The
errorTextwill only display when thehasErrorprop (in thecoregroup) is set to true - When
hideLabelis true, the label won't be visible but it will still be accessible to screen readers