Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add input_check_buttons() and input_radio_buttons() #797

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

cpsievert
Copy link
Collaborator

@cpsievert cpsievert commented Sep 12, 2023

Supersedes #485. Here's a hello world example.

library(shiny)
library(bslib)

ui <- page_fixed(
    input_check_buttons("x", state.name[1:3], selected = state.name[1:3]),
    input_radio_buttons("y", state.name[1:3]),
    input_check_buttons("z", state.name[1:10], gap = 8)
)
server <- function(input, output, session) {
    observe({
        print(input$x)
        print(input$y)
        print(input$z)
    })
}

shinyApp(ui, server)

TODO

  • Add a label argument?
  • Should we support I("all")/I("none")? Take inspiration from radioButtons()/checkboxGroupInput()?
  • Should we support size = c("sm", "md", "lg")?
  • How to specify (require?) aria-label
  • Do we need to tell shiny not to bind to the inputs?
  • Consider wrapping logic up in web component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant