newforms-bootstrap
newforms-bootstrap copied to clipboard
How to create `form-horizontal`?
Hi,
How to create form-horizontal
for BS3?
Thanks for awesome library. :)
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>
}
+1
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.
I tried my hand at rebasing your work against 2.0: https://github.com/insin/newforms-bootstrap/pull/9