Learn R Programming

yonder (version 0.1.0)

menuInput: Menu input

Description

A togglable dropdown menu input. Menu inputs may be used as standalone reactive inputs or within a navInput(). For building custom, more complex dropdown elements please see dropdown().

Usage

menuInput(id, label, choices, values = choices, ...,
  direction = "down", align = "left")

Arguments

id

A character string specifying the id of the reactive input.

label

A character string or tag element specifying the label of the menu's toggle button.

choices

A character vector specifying the choice text of the menu's items.

values

A character vector specifying the values of the menu's items, defaults to choices.

...

Additional named arguments passed as HTML attributes to the parent element.

direction

One of "up", "right", "down", or "left" specifying which direction the menu opens, defaults to "down".

align

One or "right" or "left" specifying which side of the toggle button the menu aligns to, defaults to "left".`

See Also

Other inputs: buttonGroupInput, buttonInput, checkboxInput, chipInput, fileInput, formInput, groupInput, listGroupInput, navInput, radioInput, rangeInput, selectInput, sliderInput, textInput

Examples

Run this code
# NOT RUN {
### A simple menu

menuInput(
  id = "menu1",
  label = "Menu",
  choices = c(
    "Choice 1",
    "Choice 2",
    "Choice 3"
  )
)

### Use in navigation

navInput(
  id = "nav1",
  choices = list(
    "Tab 1",
    menuInput(
      id = "navOptions",
      label = "Tab 2",
      choices = c(
        "Option 1",
        "Option 2",
        "Option 3"
      )
    ),
    "Tab 3",
    "Tab 4"
  ),
  values = paste0("tab", 1:4)
)

# }

Run the code above in your browser using DataLab