Adds a bar at the top of the page, potentially with a title and logo image.
Usage
page_navbar(..., title = "", logo = "", breakpoint = "md",
logo.height = "24px", logo.width = "24px")
Arguments
- ...
Content to add to the navbar. Can be lists specifying submenus and their items. Each list can have entries for
"name"
(the navbar button text),"title"
(the menu title),"foot"
(the menu footer),"id"
(the ID of the menu element),"class"
(class of the menu element),"placement"
(start, top, end, or bottom),"backdrop"
(logical, whereFALSE
disables the backdrop and makes the menu shift main content), anditems
(a list of menu items).- title
A title to appear in the header.
- logo
URL of an image to appear in the header.
- breakpoint
Bootstrap breakpoint code specifying the width at which the menu collapses; default is
"md"
.- logo.height
Character or number setting the height of the logo.
- logo.width
Character or number setting the width of the logo.
Examples
page_navbar(
title = "Site Name",
list(
name = "menu",
title = "Menu",
items = list(input_select("menu select", c("a", "b")))
)
)
#> [1] "<nav class=\"navbar navbar-dark navbar-expand-md\">"
#> [2] "<div class=\"container-fluid\">"
#> [3] "<span>Site Name</span>"
#> [4] "<button type=\"button\" class=\"navbar-toggler\" data-bs-toggle=\"collapse\" data-bs-target=\"#navbar_menu\" aria-controls=\"narbar_menu\" aria-expanded=\"false\" aria-label=\"toggle navbar menu\">"
#> [5] "<span class=\"navbar-toggler-icon\"></span>"
#> [6] "</button>"
#> [7] "<div class=\"collapse navbar-collapse\" id=\"navbar_menu\">"
#> [8] "<ul class=\"navbar-nav\">"
#> [9] "<li class=\"nav-item\"><button class=\"btn btn-link\" type=\"button\" data-bs-toggle=\"offcanvas\" data-bs-target=\"#submenu1\" aria-controls=\"submenu1\">menu</button></li>"
#> [10] "</ul></div></div></nav>"
#> [11] "<div tabindex=\"-1\" id=\"submenu1\" aria-labelledby=\"submenu1_label\" class=\"offcanvas offcanvas-end\">"
#> [12] "<div class=\"offcanvas-header\">"
#> [13] "<h5 class=\"offcanvas-title\" id=\"submenu1_label\">Menu</h5>"
#> [14] "<button class=\"btn-close text-reset\" type=\"button\" data-bs-dismiss=\"offcanvas\" title=\"Close\"></button>"
#> [15] "</div>"
#> [16] "<div class=\"offcanvas-body\">"
#> [17] "<div class=\"wrapper select-wrapper\">"
#> [18] "<div class=\"form-floating\">"
#> [19] "<select class=\"auto-input form-select\" data-autoType=\"select\" id=\"menuselect\" data-default=\"-1\" data-subset=\"filtered\" data-selectionSubset=\"full_filter\">"
#> [20] "<option value=\"a\">a</option>"
#> [21] "<option value=\"b\">b</option>"
#> [22] "</select>"
#> [23] "<label for=\"menuselect\">menu select</label>"
#> [24] "</div>"
#> [25] "</div>"
#> [26] "</div>"
#> [27] "</div>"