new_nav_menu | R Documentation |
To build a new menu, give new_nav_menu()
unique keys and a list of their corresponding values.
Each line shows the menu items (keys on the left, value summaries on the right).
The summaries are pillar::obj_sum outputs, so you can change the printing methods.
Each menu item can be accessed by activate()
.
new_nav_menu( key = character(), value = list(data.frame()), attrs = NULL, ..., class = character() )
key |
A unique character vector. |
value |
A list of values corresponding to the keys. |
attrs |
A data frame for additional attributes of items (an empty data frame by default). When an item becomes active, the attrs will be added to its attributes. |
... |
Additional arguments passed to |
class |
A character vector of subclasses passed to |
A navigatr_nav_menu
object, a subclass of class data.frame
.
activate()
library(dplyr) band <- new_nav_menu(key = c("band_members", "band_instruments"), value = list(band_members, band_instruments)) band # You can also build a nested menu bands <- new_nav_menu(key = c("key1", "key2"), value = list(band, band)) bands
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.