Virtual Select widget for shiny applications built for performance. Powered by virtual-select.
🚨 🚨 🚨 This widget is now available in package shinyWidgets (>= 0.7.0 on CRAN) 🚨 🚨 🚨
You can install the development version of shinyvs from GitHub with:
# install.packages("remotes")
remotes::install_github("dreamRs/shinyvs")
Minimal example with 97310 choices from babynames package:
library(shiny)
library(shinyvs)
ui <- fluidPage(
tags$h2("Virtual Select example"),
virtualSelectInput(
inputId = "single",
label = "Single select (with 97310 choices) :",
choices = sort(unique(babynames::babynames$name)),
search = TRUE
),
verbatimTextOutput("res_single")
)
server <- function(input, output, session) {
output$res_single <- renderPrint(input$single)
}
shinyApp(ui, server)
This package use {packer} to manage JavaScript assets, see packer's documentation for more.
Install nodes modules with:
packer::npm_install()
Modify srcjs/inputs/virtual-select.js
, then run:
packer::bundle()
Re-install R package and try virtualSelectInput()
function.