Skip to content
Discussion options

You must be logged in to vote

Header and Divider are enums, not strings. In order for Header and Divider to appear we need to import them from Fluent module. We can create a helper function DropdownMenuItemType which accesses the desired field:

library(shiny)
library(shiny.fluent)

DropdownMenuItemType <- function(type) {
  JS(paste0("jsmodule['@fluentui/react'].DropdownMenuItemType."), type)
}

ui <- fluentPage(
  Dropdown(
    "dropdown",
    label = "Test multiple",
    multiSelect = TRUE,
    options = list(
      list(key = "fruitsHeader", text = "Fruits", itemType = DropdownMenuItemType("Header")),
      list(key = "apple", text = "Apple" ),
      list(key = "banana", text = "Banana" ),
      list(key = "orange", 

Replies: 1 comment

Comment options

jakubsob
Apr 5, 2022
Collaborator Author

You must be logged in to vote
0 replies
Answer selected by jakubsob
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant