0.1.3 • Published 2 years ago

eazyfill v0.1.3

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
2 years ago

Easyfill

A simple React component for autofilling popular email suffixes.

Install

npm i easyfill

Usage

function CoolReactComponent() {
    const handleAdd = (itemAdded) => {
        console.log(itemAdded);
    }

    const handleAdd = (allItemsAdded) => {
        console.log(allItemsAdded);
    }

    const handleValidation = (itemToValidate) => {
        if (itemToValidate.length > 5) {
            return true
        } else {
            return false
        }
    }

    return(
        <Easyfill
            max={10}
            onAdd={handleAdd}
            onComplete={handleComplete}
            validation={handleValidation}
            progress
        />
    )
}

API Reference

max

  max={count}
ParameterTypeDescription
countnumberMax entries to allow.

onChange

  onAdd={handleOnChange}
ParameterTypeDescription
handleOnChangefunctionFunction to call when validated items change.

onComplete

  onComplete={handleOnComplete}
ParameterTypeDescription
handleOnCompletefunctionFunction to call when validated item count reaches max.

validation

  validation={handleValidation}
ParameterTypeDescription
validationfunctionCustom validation function that takes the input to be added, and returns a boolean.

progress

  progress={showProgress}
ParameterTypeDescription
showProgressbooleanBoolean that will show/hide progress bar in bottom left.

Authors

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago