Basic elements to create dropdown menus in
1 2 3 4 5 6 7 8 9 10 11
The label to appear on the element
The id of the action element
A unique name for the group of elements.
The value to return when this element is selected.
Should this element be selected at the start?
The type of dropdown element to create.
Use these elements to create custom dropdown menus in your shiny apps. They can be used within standard dropdowns, context menus, navbar dropdowns, or submenus.
smHeader adds a grey, unclickable header to your dropdown menu.
Use it help divide your dropdowns into meaningful subsets.
smDivider adds a light, horizontal line to your dropdown menu.
It can also help to divide you dropdowns into meaningful subsets.
smAction acts exactly like a native
smRadio creates an individual radio dropdown input. When any
radio input with the same
name attribute is selected by the user, all
other elements with the same
name will be deselected, and the clicked
element will become selected. Reference the
to retrieve the value from within your Server logic. For example if
name = "foo", then from the server,
input$foo would retrieve the
value of the currently selected element within the
You can have more than one
smRadio input with the same
value. Doing so will link these inputs so that if one becomes selected,
they will all become selected. This allows you to place options in several places
in your shiny app. For example, You could allow the user to change the units of the
displayed data from a dropdown in the navbar and from a context menu. These two
locations will update based on selections from the other and you will only have
to watch one
input from your Server logic.
smCheckbox works the same as
smRadio but allows for more
than one element from a group to be selected at once.
smToggle can create radio or checkbox elements depending on the
smCheckbox are actually wrappers
type already specified. Create your dropdowns
however you like.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.