Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

label of input field #290

Closed
ofirsa opened this issue Jul 24, 2016 · 2 comments
Closed

label of input field #290

ofirsa opened this issue Jul 24, 2016 · 2 comments

Comments

@ofirsa
Copy link

ofirsa commented Jul 24, 2016

Hi All,
I have start to use this nice react component, and it is working great.
I would like to know if it is possible the place the label for an input field to the left of the input field and not above the input field (as the default behavior).
it will save a lot of space in the form.
Thanks
Saar Ofir

@n1k0
Copy link
Collaborator

n1k0 commented Aug 16, 2016

Duplicate of #301, where some comments have been made already.

@n1k0 n1k0 closed this as completed Aug 16, 2016
@mplis-jetsetter
Copy link
Contributor

@ofirsa now that #304 has landed, you can accomplish this by doing something like this:

function CustomFieldTemplate(props) {
  const {id, classNames, label, help, required, description, errors, children} = props;
  return (
    <div className={classNames}>
      <label htmlFor={id} className="col-sm-2 control-label">{label}{required ? "*" : null}</label>
      <div className="col-sm-10">
        {children}
      </div>
      {errors}
    </div>
  );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants