Learn R Programming

shinymanager (version 1.0.300)

fab_button: Create a FAB button

Description

Create a fixed button in bottom right corner with additional button(s) in it

Usage

fab_button(..., inputId = NULL, icon = NULL, status = "default")

Arguments

...

HTML tags 'a' or 'button' or actionButton (with NULL labels).

inputId

Id for the FAB button (act like an actionButton).

icon

An icon for the main button.

status

Bootstra^p status to apply to the main button.

Examples

Run this code
# NOT RUN {
if (interactive()) {
  library(shiny)
  library(shinymanager)

  ui <- fluidPage(

    tags$h1("FAB button"),

    tags$p("FAB button:"),
    verbatimTextOutput(outputId = "res_fab"),

    tags$p("Logout button:"),
    verbatimTextOutput(outputId = "res_logout"),

    tags$p("Info button:"),
    verbatimTextOutput(outputId = "res_info"),

    fab_button(
      actionButton(
        inputId = "logout",
        label = NULL,
        tooltip = "Logout",
        icon = icon("sign-out")
      ),
      actionButton(
        inputId = "info",
        label = NULL,
        tooltip = "Information",
        icon = icon("info")
      ),
      inputId = "fab"
    )

  )

  server <- function(input, output, session) {

    output$res_fab <- renderPrint({
      input$fab
    })

    output$res_logout <- renderPrint({
      input$logout
    })

    output$res_info <- renderPrint({
      input$info
    })

  }

  shinyApp(ui, server)
}
# }

Run the code above in your browser using DataLab