Created
February 3, 2017 15:27
-
-
Save heloa-net/0f738c5647bded0bb4aff747edb89e50 to your computer and use it in GitHub Desktop.
Special input field for Redux-Form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const renderSpecialInput = ({ input, label, type, meta: { touched, error }, divClass, icon, position = 'before' }) => ( | |
<div className={divClass ? divClass : ""}> | |
<label>{label}</label> | |
<div className="input-group"> | |
{icon && position === 'before' && | |
<span className="input-group-label">{icon}</span> | |
} | |
<input {...input} type={type} placeholder={label} className="input-group-field" /> | |
{touched && error && <span className="form-error is-visible">{error}</span>} | |
{icon && position === 'after' && | |
<span className="input-group-label">{icon}</span> | |
} | |
</div> | |
</div> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just sharing some stuff I was using with Redux Forms
These are some examples of different input fields you can create.
I used Foundation for sites for styling.