Clay: Move form related elements to @clayui/form package

Created on 28 Jun 2019  路  5Comments  路  Source: liferay/clay

RadioGroup, Checkbox, Autocomplete are all components that should be rolled into the @clayui/form package since they are all form related html elements. Multi-select is another component that is going into @clayui/form.

Happy to have my opinion on this changed though.

3.x clay-components

All 5 comments

hey @bryceosterhaus I've been thinking more about this, maybe it makes sense to move @clayui/date-picker, @clayui/color-picker and @clayui/time-picker are essentially part of a Form and can be composed by others in the case of their input. What do you think?

As some level, all web apps are forms. 馃槀

A good rule of thumb for whether something should actually live inside the form package might be whether it corresponds, at least conceptually, to an HTML element that falls into the "form content" category; copy-pasting from that MDN page, the list is:

  • <button>
  • <fieldset>
  • <input>
  • <keygen>
  • <label>
  • <meter>
  • <object>
  • <output>
  • <progress>
  • <select>
  • <textarea>

As some level, all web apps聽are聽forms.

I started to realize this with the PR I was working on. I agree in that we should probably only add html elements that fall into the form content category, however something like <button> makes sense to be a separate package to me, since often in a webapp we use it as an action and not necessarily always a form submission.

Overall, I would lean towards avoiding a hard and fast rule since we could probably end up just adding everything. For all of the picker components, I think I would opt to keep them separate since they are fairly complex. This nuance is the main reason I decided to start small and only move checkbox and radio for now

Makes sense, in letting separate the more complex components. I think we can go back to this whenever we have a real need and benefit.

going to close for now. Possibly re-visit in future if we see a need though.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

drakonux picture drakonux  路  5Comments

brunofarache picture brunofarache  路  5Comments

julien picture julien  路  3Comments

drakonux picture drakonux  路  3Comments

bryceosterhaus picture bryceosterhaus  路  4Comments