rstudio / sortable

R htmlwidget for Sortable.js
https://rstudio.github.io/sortable/
Other
127 stars 30 forks source link

Make it easy to have a horizontal `rank_list` #92

Closed andrie closed 1 year ago

andrie commented 1 year ago

As suggested at https://stackoverflow.com/questions/73504019/shiny-horizontal-sortable-rank-list/73504477#73504477

Related:

library(shiny)
library(sortable)

ui <- fluidPage(
    div(
        style = "width: 500px", id = "my-ranklist",
        rank_list(labels = c("/", "26", "2022", "August", "/"), 
                  input_id = "rank"),
        tags$style(HTML(
            '
            #my-ranklist .rank-list {
                display: flex;
            }
            #my-ranklist .rank-list-item {
                width: 100px;
            }
            '
        ))
    )
)

server <- function(input, output, session) {}

shinyApp(ui, server)