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

Support for layout grid #237

Closed
batusai513 opened this issue Jun 15, 2016 · 4 comments
Closed

Support for layout grid #237

batusai513 opened this issue Jun 15, 2016 · 4 comments

Comments

@batusai513
Copy link

Description

Hi, I wanted to know if there is a way to add grid support like in bootstrap where you can do the following:

<div class="row">
  <div class="col-xs-2">
    <input type="text" class="form-control">
  </div>
  <div class="col-xs-3">
    <input type="text" class="form-control">
  </div>
  <div class="col-xs-4">
    <input type="text" class="form-control">
  </div>
</div>

This would be awesome for bigger forms.

Thanks.

@n1k0
Copy link
Collaborator

n1k0 commented Jun 20, 2016

We have no support for templates atm, but this may be added in the future. Feel free to send a PR if you're willing to work on this.

@n1k0
Copy link
Collaborator

n1k0 commented Jun 28, 2016

I'm closing this. Feel free to reopen if you plan to work on this specific feature.

@n1k0 n1k0 closed this as completed Jun 28, 2016
@batusai513
Copy link
Author

@n1k0 i think i'm going to work on this because i need it for a project, any sugestions on how to tackle this.

@pablen
Copy link
Contributor

pablen commented Sep 23, 2016

I would really love support for something like that. At the moment you can achieve that kind of layout by means of Bootstrap classes in your uiSchema. Something like this:

const schema = {
  type: 'object',
  properties: {
    foo: { type: 'string' }
    bar: { type: 'string' }
    baz: { type: 'string' }
  }
};

const uiSchema = {
  classNames: 'row',
  foo: { classNames: 'col-xs-2' }
  bar: { classNames: 'col-xs-3' }
  baz: { classNames: 'col-xs-4' }
};

But this technique forces you to adapt your schema, nesting fields inside objects just for styling purposes, which I think is not cool.

You just need to wrap specific fields in .row elements, but I really can't imagine how something like this could be done in an elegant way.

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

3 participants