1.2.0 • Published 4 years ago
customizable-input-package v1.2.0
This project requires Bootstrap 4.6 imported in your ./public/index.html
PROPS:
- *state - the state that will be updated with the input's content
- *updateState - the state's that will be updated with the input's content update function
- *label - the name of the input (displayed with capital case and used in the state)
- *errors - the state that contains the errors (should be an object with the label as a prop)
- option - settings
OPTIONS (passed as prop):
Global
- inputInitialBorderColor - default: white
- col - default: not enabled
- fontSize - default: 1.2em
Input:
- inputInitialBorderColor - default: white
- inputInitialColor - default: white
- inputBackground - default: none
- inputAnimateColor - default: #FF9513
- inputAnimateBorderColor - default: #FF9513
Label:
- labelInitialColor - default: white
- labelAnimateColor - default: #FF9513
- labelCenter - default: false
function App() {
const [input, setInput] = useState({ email: '' });
const [errors, setErrors] = useState({ email: '' });
return (
<div className="container align-items-center justify-content-center p-5" style={{ background: '#243E70' }}>
<Input state={input} updateState={setInput} label={'email'} errors={errors} options={{ labelInitialColor: 'blue' }}/>
</div>
);
}
export default App;