shiny icon indicating copy to clipboard operation
shiny copied to clipboard

Feature Request: allow selectizeInput to be passed HTML

Open bborgesr opened this issue 8 years ago • 6 comments

In light of a recent PR (https://github.com/rstudio/shiny/pull/1521), Winston and I were talking that it may be nice to allow a similar thing for selectizeInput(). This would entail two things:

  1. allowing users to pass two args (choiceNames and choiceValues), instead of one (choices). We may do this in #1521 still, so that the APIs for constructing radioButtons, checkboxGroupInput and select(ize)Input look similar and consistent.

  2. allowing the choiceNames argument to selectizeInput (does not apply to selectInput) be a list whose elements can be arbitrary HTML/tags objects.

For example, it would be nice to allow users to do something like this.

bborgesr avatar Mar 23 '17 19:03 bborgesr

That kind of customization would be very helpful indeed.

GitHunter0 avatar Jan 14 '22 00:01 GitHunter0

Has there been any progress on that one?

ColinFay avatar Mar 03 '22 09:03 ColinFay

You can use my package shinySelect for that. It is on CRAN.

stla avatar Mar 16 '22 05:03 stla

Thank you @stla , shinySelect is beautiful!

Is there a way to make it support a large number of choices? selectizeInput can't handle well thousands of choices for example.

GitHunter0 avatar Mar 16 '22 22:03 GitHunter0

@GitHunter0 If your only issue with selectizeInput is wanting it to scale better, have you tried "server-side selectize" mode? https://shiny.rstudio.com/articles/selectize.html#server-side-selectize It's great for searching among thousands of choices (but I think you can only browse the first 1000 or so).

jcheng5 avatar Mar 17 '22 00:03 jcheng5

Thank you @jcheng5 , I have tried but it gets slow and freezy really fast as the choices increase. Ideally, I would like it to handle hundreds of thousands. Thankfully, shinyvs was launched to do this hard work.

I asked about shinySelect , because it would be great to combine in one component layout flexibility and scalability.

GitHunter0 avatar Mar 17 '22 00:03 GitHunter0