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

react-native-chocoforms

v1.1.53

Published

A package that aims to speed up form creation in react native

Downloads

102

Readme

react-native-chocoforms

A package that aims to automate form generation in react native. Doing so by passing a single configuration object to the component.

props

Component props

| Parameter | Type | Description | | :-------- | :------- | :------------------------- | | form | object | Required. Your form configuration object, details below | | onFormChange | function | Required. Callback function that receives the updated form as a parameter | | lang | enUS/esMX | Required. Language in which the validation messages will be shown | | inputStyle | object | Optional. Style applied to each input in the form before interacted | | inputStyleTouched | object | Optional. Style applied to each input in the form when it is touched | | inputStyleBlured | object | Optional. Style applied to each input in the form when it is blurred |

Example of the configuration object

this.state= {
    form: {
        controls: {
            UserName: {
                elementType: 'input', // what kind of input should it render (input, currency, time, date, select)
                elementConfig: { // Everything here will be copied to the input directly
                    placeholder: 'Username',
                    autoCapitalize: 'words'
                },
                label: 'Username*', // Label descriptive of the input
                value: '',
                errorMessage: '', // Error message of this specific input, managed by the component
                validation: { // All validations
                    required: true,
                    isEmail: true, //Basic validation for an email format [email protected]
                    isPhone: false, // 10 digit number validation
                    isEmailOrPhone: false, // If it's either an email or a phone it's valid
                    limitAllowedCharacters: true, // Characters used must be one of these: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.1234567890
                    isPassword: false, // Checks for a min length of 6 characters, an uppercase and a number
                    minLength: false, // Minimun length of characters for the input to be valid
                    maxLength: false, // Max length of characters for the input to be valid
                    equalsTo: 'NameOfSomeOtherControlInTheConfiguration', // Validates that this input has the same value as another input in the controls part of the configuration
                    isUrl: false // Regex validation for an url
                },
            },
            RoleID: {
                elementType: 'select',
                elementConfig: {
                    placeholder: 'Role',
                },
                label: 'Role*',
                value: '',
                text: '', // For 'select' only
                options: [{   // For 'select' only
                    id: 1,
                    text: 'example'
                },{
                    id: 2,
                    text: 'example 2'
                }],
                errorMessage: '',
                validation: {
                    required: true
                },
            },
            Password: {
                elementType: 'input',
                elementConfig: {
                    placeholder: 'Password',
                    autoCapitalize: 'none'
                },
                label: 'Password*',
                value: '',
                errorMessage: '',
                validation: {
                    required: true,
                    isPassword: true
                },
            },
        },
        isValidForm: false, // Will determine if the form is inline with the validations in the config object.
        generalError:{
            show: true,
            text: 'Some custom error you want to show'
        }
    }
}

Badges

MIT License