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

asp-react-native-custom-controls

v1.2.7

Published

ASP Custom Controls for React Native

Downloads

40

Readme

aspCustomControls

ASP Custom Controls for React Native

Installing Package

npm i asp-react-native-custom-controls

Installing Dependencies

npm i react-native-responsive-screen
Then do pod install cd ios then pod install

Controls

  1. Custom TextInput ASPTextInput

Usage

How to use ASPTextInput

Import

import {ASPTextInput} from 'asp-react-native-custom-controls';

Usage

<ASPTextInput />

Props

placeholder => provide placeholder
value => map the value from your state
onChangeText => pass your function for onChangeText
type => provide keyboard type if no values provided it will use 'default'
inputRef => provide your reference if using useRef hook
onSubmitEditing => provide your function for handling submit editing
returnKeyType => provide return key type example 'next' or 'done'
BorderColor => provide BorderColor for the text input
BorderFocusColor => provide BorderFocusColor for the text input when it receives focus
style => styles object(optional) example {fontFamily:'Ubuntu',fontSize:18,fontWeight:'500'}

Example

import React, {useEffect, useRef, useState} from 'react';
import {
  View,
  Text,
  StyleSheet,
  SafeAreaView,
  Image,
  ScrollView,
  TextInput,
  Platform,
} from 'react-native';

import {
  THEME_BORDER_COLOR,
  THEME_BORDER_ONFOCUS_COLOR,
  THEME_COLOR,
  THEME_TITTLE_COLOR,
} from '../utils/Colors';

import {ASPTextInput} from 'asp-react-native-custom-controls';

import {heightPercentageToDP as hp} from 'react-native-responsive-screen';

const Signup = () => {
  const [name, setName] = useState('');
  const [email, setEmail] = useState('');
  const [mobile, setMobile] = useState('');
  const [password, setPassword] = useState('');
  const [confirmPassword, setConfirmPassword] = useState('');
  const nameRef = useRef(null);
  const emailRef = useRef(null);
  const mobileRef = useRef(null);
  const passwordRef = useRef(null);
  const confirmPasswordRef = useRef(null);

  useEffect(() => {
    if (nameRef.current) {
      nameRef.current.focus();
    }
  }, []);

  const handleSubmitEditing = ref => {
    if (ref.current) {
      ref.current.focus();
    }
  };

  return (
    <SafeAreaView style={styles.container}>
      <Image
        source={require('../assets/images/banner.jpg')}
        style={styles.banner}
      />

      <View style={styles.card}>
        <ScrollView>
          <Text style={styles.title}>Register</Text>
          <ASPTextInput
            inputRef={nameRef}
            placeholder={'Enter Name'}
            value={name}
            onChangeText={val => {
              setName(val);
            }}
            style={textStyle}
            BorderColor={THEME_BORDER_COLOR}
            BorderFocusColor={THEME_BORDER_ONFOCUS_COLOR}
            onSubmitEditing={() => handleSubmitEditing(emailRef)}
          />
          <ASPTextInput
            inputRef={emailRef}
            placeholder={'Enter Email'}
            value={email}
            onChangeText={val => {
              setEmail(val);
            }}
            type={'email-address'}
            style={textStyle}
            BorderColor={THEME_BORDER_COLOR}
            BorderFocusColor={THEME_BORDER_ONFOCUS_COLOR}
            onSubmitEditing={() => handleSubmitEditing(mobileRef)}
          />
          <ASPTextInput
            inputRef={mobileRef}
            placeholder={'Enter Mobile'}
            value={mobile}
            onChangeText={val => {
              setMobile(val);
            }}
            type={'number-pad'}
            style={textStyle}
            returnKeyType={'next'}
            BorderColor={THEME_BORDER_COLOR}
            BorderFocusColor={THEME_BORDER_ONFOCUS_COLOR}
            onSubmitEditing={() => handleSubmitEditing(passwordRef)}
          />
          <ASPTextInput
            inputRef={passwordRef}
            placeholder={'Enter Password'}
            value={password}
            onChangeText={val => {
              setPassword(val);
            }}
            style={textStyle}
            BorderColor={THEME_BORDER_COLOR}
            BorderFocusColor={THEME_BORDER_ONFOCUS_COLOR}
            onSubmitEditing={() => handleSubmitEditing(confirmPasswordRef)}
          />
          <ASPTextInput
            inputRef={confirmPasswordRef}
            placeholder={'Enter Confirm Password'}
            value={confirmPassword}
            onChangeText={val => {
              setConfirmPassword(val);
            }}
            style={textStyle}
            BorderColor={THEME_BORDER_COLOR}
            BorderFocusColor={THEME_BORDER_ONFOCUS_COLOR}
          />
        </ScrollView>
      </View>
    </SafeAreaView>
  );
};
const textStyle = {
  fontFamily: 'Poppins',
  fontSize: hp('1.8%'),
  fontWeight: '500',
};
const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  banner: {
    width: '100%',
    height: Platform.OS === 'ios' ? hp('35%') : hp('38%'),
    // height: verticalScale(195),
    resizeMode: 'cover',
  },
  card: {
    width: '100%',
    alignSelf: 'center',
    height: '100%',
    backgroundColor: 'white',
    position: 'absolute',
    elevation: 5,
    borderTopLeftRadius: 40,
    borderTopRightRadius: 40,
    top: Platform.OS === 'ios' ? hp('33.5%') : hp('32%'),
  },
  title: {
    alignSelf: 'center',
    fontFamily: 'Ubuntu',
    fontSize: hp('2.5%'),
    // fontSize: scaleFontSize(25),
    fontWeight: Platform.OS === 'ios' ? '600' : '700',
    color: THEME_TITTLE_COLOR,
    marginTop: 20,
  },
});

export default Signup;

Controls

  1. ASPButton

Import

import {ASPButton} from 'asp-react-native-custom-controls';

Usage

<ASPButton />

Props

style => styles object(optional) example {fontFamily:'Ubuntu',fontSize:18,fontWeight:'500'}
title => Button Name if you don't provide it will set it to 'Please Set Title'
onClicked => pass on your onPress function onClicked={()=>{console.log('Button clicked)}}