inst/examples/Menu/ui.R

library(shiny)
library(shinyChakraUI)

shinyUI(
  chakraPage(

    br(),
    chakraComponent(
      "title",
      Tag$Heading("Simple menu."),
      Tag$Text(
        "Set a ",
        Tag$Code(colorScheme = "yellow", "value"),
        " attribute to the ",
        Tag$Code(colorScheme = "yellow", "MenuItem"),
        " tags."
      )
    ),
    br(), tags$hr(), br(),

    ######################

    fluidRow(

      column(
        width = 6,
        chakraComponent(
          "mycomponent",
          Tag$Menu(
            id = "mymenu",
            Tag$MenuButton(
              colorScheme = "red",
              "Menu"
            ),
            Tag$MenuList(
              minWidth = "240px",
              Tag$MenuItem(
                value = "item1",
                icon = Tag$ArrowRightIcon(),
                "Item one"
              ),
              Tag$MenuItem(
                value = "item2",
                icon = Tag$ArrowRightIcon(),
                "Item two"
              )
            )
          )
        )
      ),

      column(
        width = 6,
        tags$span(
          style = "color: red; font-size: 28px;",
          "Menu value:"
        ),
        verbatimTextOutput("menuValue")
      )

    )

  )
)

Try the shinyChakraUI package in your browser

Any scripts or data that you put into this service are public.

shinyChakraUI documentation built on Jan. 5, 2022, 5:08 p.m.