Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Select inputs should be able to have custom styles #107

Open
gwenf opened this issue Oct 1, 2020 · 6 comments
Open

Select inputs should be able to have custom styles #107

gwenf opened this issue Oct 1, 2020 · 6 comments

Comments

@gwenf
Copy link

gwenf commented Oct 1, 2020

Two requests:

  • this functionality should be implemented
  • an example of a fully styled form should with select dropdowns included should be added to the documentation

Is it possible and in line with the goals of this project to make a custom select dropdown to allow for more custom styling options?

@wojciech-borawski
Copy link

Yes, as we know the native html select inputs are not fully style-able in terms of it's options.
Because of that many component libraries decided to use "divs" and other elements to simulate the select input and give it full css cross-browser customization.

But often those solutions make the component "messy" in terms of having too many html elements.

I don't know where is the best solution nor if it exist but I would like to know if this problem is or will be addressed.

@AustinGil
Copy link
Owner

I have a couple of thoughts on this. I do want the documentation to go into more examples of what the full extent of custmoization is. I'm also not sure what sort of customization you're talking about.

The intent for components named after HTML tags (VForm, VInput) is to behave as close to their native counterparts as possible but with some super powers. So <VInput type="select"> should implement a select element and behave the same way, with all the good and bad that it means so that users know what to expect. Selects are inherently limited for customization, but if the customizations you have in mind can be done with the native <select> and <option>, then I'm all for it.

Regarding a select component that is even more customizeable (multi tag selection, search filter for options, custom html options) I've already thought about implementing something that would solve your issues, but as a different component than <VInput> The names "combobox" or "multi-select" come to mind from what I've seen most often.

There is an excellent article that I think gets the closest to what I would like to do https://sarahmhigley.com/writing/select-your-poison/

I'd really like to add this as well because I think it's quite a common element, but its a matter of time. The most important thing is that it's accessible and intuitive, and I think the hardest part has been finding an example that does it all well. The article above is probably my favorite so far.

@wojciech-borawski
Copy link

I see, if that's the case then we just have wait for those custom components :)

@AustinGil
Copy link
Owner

Yeah. Im sorry, I really want to keep pushing out cool stuff, but I've had a lot on my plate...

image

@Kikketer
Copy link

Kikketer commented Nov 4, 2020

I'm currently just experimenting with Vue and seeing how it would compare to what I'm currently building with React. This library is a really good 1:1 fit with A11Y components, except for the select box. I realize it's incredibly complicated and take this as a "keep it up".

What we are using for the select element is the Adobe Aria library (https://react-spectrum.adobe.com/react-aria/useSelect.html). It's incredibly complex but it works. Seeing the inputs you have setup for "auto labels" and the like are really really appealing.

Keep up the good work, I'm keeping my eye on Vue and the well built libraries such as this.

@AustinGil
Copy link
Owner

Thanks @Kikketer. I really appreciate the kind words. Im looking forward to nailing some stuff down for the v1 release, but I keep finding more things to fix o.O

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

No branches or pull requests

4 participants