horizontal_menu: Horizontal menu

Description Usage Arguments Value Examples

View source: R/menu.R

Description

Renders UI with horizontal menu

Usage

1
horizontal_menu(menu_items, active_location = "", logo = NULL)

Arguments

menu_items

list with list that can have fields: "name" (mandatory), "link" and "icon"

active_location

active location of the menu (should match one from "link")

logo

optional argument that displays logo on the left of horizontal menu, can be character with image location, or shiny image object

Value

shiny div with horizontal menu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(shiny.semantic)
menu_content <- list(
 list(name = "AA", link = "http://example.com", icon = "dog"),
 list(name = "BB", link = "#", icon="cat"),
 list(name = "CC")
)
if (interactive()){
  ui <- semanticPage(
   horizontal_menu(menu_content)
  )
  server <- function(input, output, session) {}
  shinyApp(ui, server)
}

Example output

Attaching package:shiny.semanticThe following object is masked frompackage:graphics:

    grid

The following object is masked frompackage:utils:

    menu

shiny.semantic documentation built on Nov. 7, 2021, 5:07 p.m.