Skip to content

Latest commit

 

History

History
68 lines (44 loc) · 1.83 KB

README.md

File metadata and controls

68 lines (44 loc) · 1.83 KB

shinyvs

Lifecycle: experimental R-CMD-check

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) 🚨 🚨 🚨

Installation

You can install the development version of shinyvs from GitHub with:

# install.packages("remotes")
remotes::install_github("dreamRs/shinyvs")

Example

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)

Development

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.