
Last chance! 50% off unlimited learning
Sale ends in
Add a navigation bar to your application with navbar()
. Navigation bars may
include a tab toggle (useful for multi-page applications), inline forms
(perhaps a search feature or login item), or character strings to add simple
text. Navbars are responsive and will collapse on small screens, think mobile
device. A button is automatically added to toggle between the collapsed and
expanded states.
navbar(..., brand = NULL, collapse = NULL)
A tab toggle, inline forms, or text to add to include as part of the navigation bar.
A tag element or text placed on the left end of the navbar,
defaults to NULL
, in which case nothing is added.
One of "sm"
, "md"
, "lg"
, "xl"
, or NULL
specifying
the breakpoint at which the navbar collapes, defaults to NULL
, in which
case the navbar is always expanded.
# NOT RUN {
### Navbar with tabs
div(
navbar(
brand = "Navbar",
navInput(
id = "tabs",
choices = c("Home", "About", "Our process")
) %>%
margin(right = "auto"),
formInput(
inline = TRUE,
id = "navForm",
searchInput("search", placeholder = "Search") %>%
margin(right = c(sm = 2)),
submit = buttonInput("search", "Search") %>%
background("amber")
)
) %>%
background("teal"),
container(
navContent(
navPane(
h3("Home")
),
navPane(
h3("About")
),
navPane(
h3("The process")
)
)
)
)
# }
Run the code above in your browser using DataLab