npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@optisolbusiness/react-native-text-input

v0.0.11

Published

react native TextInput

Downloads

12

Readme

react-native-text-input

@optisolbusiness/react-native-text-input

Installation

npm i @optisolbusiness/react-native-text-input

Usage

import { InputTextComponent } from '@optisolbusiness/react-native-text-input';

// ...

<InputTextComponent
  title={'first_name'}
  isMandatory={true}
  value={name}
  placeholder={'Enter Your Name'}
  inputStyle={{ color: 'blue'}}
  textBoxContainerStyle={{ marginTop: 10 , borderRadius: 20,  height: 45,}}
  isError={false}
  isErrorOutline={false}
  keyboardType="default"
  returnKey={'next'}
  errorMessage={'invalid name'}
  onChangeText={(item) => updateTextValue(item, 'name')}
  onFocus={() => updateButtonValue('blur')}
/>

Example for Usage of imagePosition and imageComponent


export default function App() {
  const [showPassword, setShowPassword] = useState(true);

  const renderEyeIcon = () => {
    return (
      <TouchableOpacity onPress={() => setShowPassword(!showPassword)}>
        {!showPassword && <Image
          source={require('./assets/images/eyeUnhide.png')}
        />}
        {showPassword && <Image
          source={require('./assets/images/eyeHide.png')}
        />}
      </TouchableOpacity>
    );
  };

  return (

      <InputTextComponent
        secureText={showPassword}
        imagePosition={true}
        imageComponent={() => renderEyeIcon()}
      />
  )
}

Props and Methods

| Prop | Type | Description | :------------ |:---------------| :-----| | showTitle | boolean | Optional. Enable to show title for textinput | | title | String | Optional. TextInput title (heading) | | titleStyle | Style | Optional. text input title (heading) style | | isMandatory | boolean | Optional. to show mandatory symbol adjacent to text input | | mainContainer | Style | Optional. styling for whole contianer | | placeholder | String | Optional. placeholder for textinput | | disabled | boolean | Optional. If you do not wish to allow editing in the text field, you can set the value to false. | | value | String | Optional. Specify the value to be displayed in the text input field | | secureText | boolean | Optional. make true for sensitive text like passwords to stay secure | | keyboardType | String | Optional. Determines which keyboard to open | | returnKey | String | Optional. Determines how the return key should look | | inputStyle | Style | Optional. styling for text input | | onChangeText | Function | Mandatory. Callback that is called when the text input's text changes. Changed text is passed as a single string argument to the callback handler | | onFocus | Function | Optional. Callback that is called when the text input is focused | | onBlur | Function | Optional. Callback that is called when the text input is blurred | | onSubmitting | Function | Optional. Callback that is called when the text input's submit button is pressed. | | onEndEditting | Function | Optional. Callback that is called when text input ends | | maxLength | Number | Optional. Limits the maximum number of characters that can be entered | | multiline | boolean | Optional. If true, the text input can be multiple lines. The default value is false |

Note: It is important to note that this aligns the text to the top on iOS, and centers it on Android. Use with textAlignVertical set to top for the same behavior in both platforms.

| Prop | Type | Description | :------------ |:---------------| :-----| | numberOfLines | Number | Optional. Use it with multiline set to true to be able to fill the lines | | blurOnSubmit | boolean | Optional. If true, the text field will blur when submitted | | onPressIn | Function | Optional. Callback that is called when a touch is engaged | | inputRef | Function | Optional. reference of text input | | testID | String | Optional. testID of text input | | isErrorOutline | boolean | Optional. enable to show bordercolor for textinput when there is error | | isErrorBorderColor | color | Optional. border color to text input when there is error must make isErrorOutline to true to use isErrorBorderColor prop | | notErrorBorderColor | String | Optional. border color to text input when there is no error default is black | | textBoxContainerStyle | Style | Optional. Specify the styling properties for the outer container of a text box, such as borderRadius and borderWidth. | | errorMessage | Style | Optional. styling of text box outer container like borderRadius, bordrWidth... | | isError | boolean | Optional. to show error message | | errorTextStyle | Style | Optional. error text style | | errorMessage | String | Optional. error message text | | imagePosition | boolean | Optional. To position an image, such as an eye icon or a calendar icon, on the right corner of a text input, | | imageComponent | Function | Optional. To show icon on the right corner of the text input and when pressed, you can implement a functionality, Must make imagePosition to true |

To enable a pop-up to appear when hovering over an icon, you would need to install the "react-native-popup-menu" library. This pop-up menu will be displayed adjacent to a text input field, and its primary function is to provide additional information relevant to that particular input.

Installation


npm i react-native-popup-menu

If using iOS please remember to install cocoapods by running: npx pod-install

Wrap your application inside MenuProvider and then simply use Menu component where you need it. Below you can find a simple example.


import { MenuProvider } from 'react-native-popup-menu';

export const App = () => (
      <MenuProvider>
        <YourApp />
      </MenuProvider>
);

      <InputTextComponent
      infoEnable={true}
      menuTriggerImageComponent={ () => <Image
          source={require('./assets/images/icon.png')}/>}
      triggerText={'Text to be shown'}
      triggerTextStyle={{color: 'pink'}}
      triggerStyle={{marginLeft: 10}}
      optionsContainerStyle={{borderColor: 'red',borderRadius:2, marginTop: 19}}
      />

Below are props for react-native-popup-menu

| Prop | Type | Description | :------------ |:---------------| :-----| | infoEnable | boolean | Mandatory. to enable pop-up menu | | triggerStyle | Style | Optional. Define the styles for the triggerWrapper within the MenuTrigger | | optionsContainerStyle | Style | Optional. Define the styles for the optionsContainer within the MenuOptions | | triggerTextStyle | Style | Optional. trigger text style | | triggerText | String | Mandatory. to show trigger text | | menuTriggerImageComponent | Function | Mandatory. To display an image that triggers a pop-up when hovered over |

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library