AustinGil / vuetensils

🍴 A tasty toolset for Vue.js 🛠 - Lightweight, functional components to boost your next project.
https://vuetensils.austingil.com/
MIT License
661 stars 38 forks source link

Select inputs should be able to have custom styles #107

Open gwenf opened 3 years ago

gwenf commented 3 years ago

Two requests:

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?

SeekerOfTrueCode commented 3 years ago

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 commented 3 years ago

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.

SeekerOfTrueCode commented 3 years ago

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

AustinGil commented 3 years ago

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

image

Kikketer commented 3 years ago

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 commented 3 years ago

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