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

How to create form-horizontal? #4

Open
darthwade opened this issue Apr 14, 2015 · 4 comments
Open

How to create form-horizontal? #4

darthwade opened this issue Apr 14, 2015 · 4 comments

Comments

@darthwade
Copy link

Hi,

How to create form-horizontal for BS3?

Thanks for awesome library. :)

@insin
Copy link
Owner

insin commented Apr 16, 2015

Support for this is yet to be added, as per the TODO in the README.

I was considering borrowing this configuration idea from @gcanti's tcomb-form, which would result in an API something like:

  render() {
    return <form className="form-horizontal" onSubmit={this._onSubmit}>
      <forms.RenderForm form={SignupForm} ref="signupForm">
        <BootstrapForm horizontal={{
          md: [3, 9],
          sm: [6, 6]
        }}/>
      </forms.RenderForm>
      <button>Sign Up</button>
    </form>
  }

@catskul
Copy link

catskul commented Jul 21, 2015

+1

@seanadkinson
Copy link

Added this and some other things in my PR, #8. The API is basically what you said @insin, except you don't need to specify the 12-n for the label, so just:

<BootstrapForm horizontal={{sm: 10 }} />

I had to build on top of 1.11 since we haven't been able to upgrade react, but I think it was a pretty small change to 2.0.0 that could be re-added.

@catskul
Copy link

catskul commented Sep 26, 2015

I tried my hand at rebasing your work against 2.0: #9

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

No branches or pull requests

4 participants