taskItem: Custom taskItem

Description Usage Arguments Examples

Description

Custom taskItem

Usage

1
taskItem(text, value = 0, color = "aqua", href = NULL, inputId = NULL)

Arguments

text

The task text.

value

A percent value to use for the bar.

color

A color for the bar. Valid colors are listed in validColors.

href

An optional URL to link to.

inputId

If not NULL, this item behaves like an action button.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
if (interactive()) {
 library(shiny)
 library(shinydashboard)
 library(shinydashboardPlus)
 
 shinyApp(
   ui = dashboardPage(
     dashboardHeader(
       dropdownMenu(
         type = "tasks", 
         badgeStatus = "danger",
         taskItem(
           inputId = "mytask",
           value = 20, 
           color = "aqua",
           text = "Click me!"
         ),
         taskItem(
           value = 40, 
           color = "green",
           text = "Basic item"
         )
       )
     ),
     dashboardSidebar(),
     dashboardBody(),
     title = "Dashboard example"
   ),
   server = function(input, output) {
     observeEvent(input$mytask, {
       showModal(modalDialog(
         title = "Important message",
         "This is an important message!"
       ))
     })
   }
 )
}

shinydashboardPlus documentation built on Sept. 16, 2021, 1:06 a.m.