thisbeyond / solid-select

The Select component for Solid.
https://solid-select.com
MIT License
172 stars 18 forks source link

Since there is no grouping of option yet, can we insert arbitrary html in the name? #34

Open kevinelliott opened 1 year ago

kevinelliott commented 1 year ago

I'd like to have a TAG in front of the name of the results to indicate what kind of content it is, since there's no grouping yet. Is this possible?

martinpengellyphillips commented 1 year ago

Yes, you can put arbitrary tags in the format option to control what's rendered. I'll try to add an example in the coming days (along with how groups can be emulated using disabled options and some custom styling).

martinpengellyphillips commented 1 year ago

FYI I've added a grouping example to the demo site now - search for 'Grouping' in the select box. The main issue is that the group headers are included in the navigation - I think I will add something to the core to deal with that longer term (and possibly bundle the createGroupedOptions approach once tested more.

kevinelliott commented 1 year ago

Thanks, how can I use this with async?

kevinelliott commented 1 year ago
Screenshot 2023-03-07 at 7 45 03 PM
kevinelliott commented 1 year ago

@martinpengellyphillips Any thoughts?

martinpengellyphillips commented 2 months ago

Did you try modifying the example to use createAsyncOptions helper?