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

Form layout element [💰20] #58

Closed
jouni opened this issue Jun 21, 2016 · 5 comments
Closed

Form layout element [💰20] #58

jouni opened this issue Jun 21, 2016 · 5 comments
Labels

Comments

@jouni
Copy link
Member

jouni commented Jun 21, 2016

An element which makes it easy to build common form layouts.

Core features

At minimum, it should provide a way to present field labels/captions on the left side of the field (or right side for RTL languages). When there is not enough horizontal space, the label should be moved on top of the field. The label width should be uniform for all rows in the layout, so that the left (or right on RTL) edge of the fields align. It should be possible to align the labels in the "label column" either left or right (right-aligned being the default perhaps).

It should be possible to layout fields in 2 columns (possibly more in the future if that is seen as a common use case), and some fields can span multiple columns. The columns should also wrap when horizontal space is limited.

It should be possible to divide the overall form into sections using section headers/dividers.

The fields can be any input element, such as text inputs, dropdowns, checkboxes, radio groups, sliders, etc.

The labels could be either "floating" or static. Floating labels probably don’t make much sense for the "column layout" version.

Mockups

Wide layout:

wide

Medium layout:

medium

Narrow layout:

narrow

More features

  • Required field indicators
  • Error indication/messages
    • At first, any field error indicators should be placed underneath the field (like paper-input does for instance). After that, it should be possible to move the error messages to the right side of the field, when the label is on the left side (and vice versa for RTL).
  • Help/description messages (similar as error messages, but these are always visible)
  • Form level error summary

Inspiration

A proof-of-concept example how required indicators, help/description and error messages could be shown, and how help/description/error messages and floating labels could work when the label is placed on the left side of the field: http://codepen.io/jouni/full/dcrAu/

You can also google for "form layout" to get inspiration.

@joeblew99
Copy link

looks very nice @jouni
Looking forward to trying it out

@wolfie wolfie changed the title Form layout element Form layout element [20] Aug 17, 2016
@wolfie wolfie changed the title Form layout element [20] Form layout element [💰20] Aug 17, 2016
@jouni
Copy link
Member Author

jouni commented Jan 11, 2017

As requested in the team grooming, here’s a mockup of a very minimum we should implement first:

form-layout-mvp

@jouni
Copy link
Member Author

jouni commented Jan 13, 2017

Talked with our internal design team, and was reminded of some important requirements:

  • You should be able to specify a label for any arbitrary element/group of fields. So if the component itself doesn’t have a label property/attribute built in (like the upcoming vaadin-input), the developer should be able to define a label that is managed by the form layout.
  • The same goes for error messages: if a field component (like vaadin-input) has its own error message, the form layout should be able to “adopt” it. But if the component doesn’t have its own error message, the developer should be able to define one, which the form layout will manage.
  • And the same for description messages
  • The developer should be able to modify the form layout label template, in order to add icon buttons or other kinds of customizations to it.

@Saulis
Copy link
Contributor

Saulis commented Mar 22, 2017

Ping @macjuan ^^ here are some ideas for form layout (should be moved to ProdPad).

@jouni
Copy link
Member Author

jouni commented Mar 29, 2017

Since this element now has its own repo, and it has been split into separate features, I’m closing this one. Please follow the issues/milestones in the https://github.com/vaadin/vaadin-form-layout/ repo.

@jouni jouni closed this as completed Mar 29, 2017
@jouni jouni removed the backlog label Mar 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants