Package 'tablerDash'

Title: 'Tabler' API for 'Shiny'
Description: 'R' interface to the 'Tabler' HTML template. See more here <https://tabler.io>. 'tablerDash' is a light 'Bootstrap 4' dashboard template. There are different layouts available such as a one page dashboard or a multi page template, where the navigation menu is contained in the navigation bar.
Authors: David Granjon [aut, cre], RinteRface [cph], codecalm [ctb, cph] (tabler template for Bootstrap 4), Winston Chang [ctb, cph] (Utils functions from shinydashboard)
Maintainer: David Granjon <[email protected]>
License: GPL (>= 2)
Version: 0.1.5
Built: 2024-10-26 06:12:51 UTC
Source: https://github.com/rinterface/tablerdash

Help Index


Create a Boostrap 4 alert

Description

Build a tabler alert

Usage

tablerAlert(..., title = NULL, status, icon = NULL, closable = TRUE)

Arguments

...

Alert content.

title

Alert title.

status

Alert status. See https://preview.tabler.io/docs/colors.html.

icon

Alert icon.

closable

Whether to close the alert. TRUE by default.

Author(s)

David Granjon, [email protected]

Examples

if(interactive()){
 library(shiny)
 library(tablerDash)

 shiny::shinyApp(
   ui = tablerDashPage(
    navbar = NULL,
    footer = NULL,
    title = "test",
    body = tablerDashBody(
     tablerAlert(
      title = "Alert",
      "Lorem ipsum dolor sit amet, consectetur
      adipisicing elit. Lorem ipsum dolor sit
      amet, consectetur adipisicing elit.
      Lorem ipsum dolor sit amet, consectetur
      adipisicing elit.",
      icon = "alert-triangle",
      status = "info"
     )
    )
   ),
   server = function(input, output) {}
 )
}

Create a Boostrap 4 avatar

Description

Build a tabler avatar

Usage

tablerAvatar(name = NULL, url = NULL, size = NULL, status = NULL, color = NULL)

Arguments

name

Avatar placeholder. If not NULL, url cannot be used.

url

Avatar image if any. If not NULL, name cannot be used.

size

Avatar size. NULL, "sm", "md", "lg", "xl" or "xxl".

status

Avatar status. See https://preview.tabler.io/docs/colors.html for valid statuses.

color

Avatar background color. See https://preview.tabler.io/docs/colors.html for valid colors.

Author(s)

David Granjon, [email protected]

Examples

if(interactive()){
 library(shiny)
 library(tablerDash)

 shiny::shinyApp(
   ui = tablerDashPage(
    navbar = NULL,
    footer = NULL,
    title = "test",
    body = tablerDashBody(
     tablerAvatar(
      name = "DG",
      size = "xxl"
     ),
     tablerAvatar(
      name = "DG",
      color = "orange"
     ),
     tablerAvatar(
      name = "DG",
      status = "warning"
     ),
     tablerAvatar(url = "https://image.flaticon.com/icons/svg/145/145852.svg")
    )
   ),
   server = function(input, output) {}
 )
}

Create a Boostrap 4 avatar list

Description

Build a tabler avatar list

Usage

tablerAvatarList(..., stacked = FALSE)

Arguments

...

Slot for tablerAvatar.

stacked

Whether to stack avatars. FALSE by default.

Author(s)

David Granjon, [email protected]

Examples

if(interactive()){
 library(shiny)
 library(tablerDash)

 shiny::shinyApp(
   ui = tablerDashPage(
    navbar = NULL,
    footer = NULL,
    title = "test",
    body = tablerDashBody(
     tablerAvatarList(
      stacked = TRUE,
      tablerAvatar(
       name = "DG",
       size = "xxl"
      ),
      tablerAvatar(
       name = "DG",
       color = "orange"
      ),
      tablerAvatar(
       name = "DG",
       status = "warning"
      ),
      tablerAvatar(url = "https://image.flaticon.com/icons/svg/145/145852.svg")
     )
    )
   ),
   server = function(input, output) {}
 )
}

Create a Boostrap 4 blog card

Description

Build a tabler blog card

Usage

tablerBlogCard(
  ...,
  title = NULL,
  author = NULL,
  date = NULL,
  href = NULL,
  src = NULL,
  avatarUrl = NULL,
  width = 4,
  horizontal = FALSE
)

Arguments

...

Any other elements.

title

Title.

author

Blog post author.

date

Date.

href

External link.

src

Image url.

avatarUrl

Avatar image.

width

Card width. 4 by default.

horizontal

Whether the card is horizontally displayed. FALSE by default.

Author(s)

David Granjon, [email protected]

Examples

if(interactive()){
 library(shiny)
 library(tablerDash)

 shiny::shinyApp(
   ui = tablerDashPage(
    navbar = NULL,
    footer = NULL,
    title = "test",
    body = tablerDashBody(
     tablerBlogCard(
      title = "Blog Card",
      author = "David",
      date = "Today",
      href = "https://www.google.com",
      src = "https://preview.tabler.io/demo/photos/matt-barrett-339981-500.jpg",
      avatarUrl = "https://image.flaticon.com/icons/svg/145/145842.svg",
      width = 6,
      "Look, my liege! The Knights Who Say Ni
      demand a sacrifice! …Are you suggesting
      that coconuts migr..."
     )
    )
   ),
   server = function(input, output) {}
 )
}

Create a Boostrap 4 card

Description

Build a tabler card

Usage

tablerCard(
  ...,
  title = NULL,
  options = NULL,
  footer = NULL,
  status = NULL,
  statusSide = c("top", "left"),
  collapsible = TRUE,
  collapsed = FALSE,
  closable = TRUE,
  zoomable = TRUE,
  width = 6,
  overflow = FALSE
)

Arguments

...

Body content

title

Card title. If NULL, the header is not displayed.

options

Card extra header elements.

footer

Card footer. NULL by default. Not displayed if NULL.

status

Card status. NULL by default. See https://preview.tabler.io/docs/colors.html for valid statuses.

statusSide

Status side: "top" or "left".

collapsible

Whether the card is collapsible. TRUE by default.

collapsed

Whether to collapse the card at start. FALSE by default.

closable

Whether the card is closable. TRUE by default.

zoomable

Whether the card is zoomable. TRUE by default.

width

Card width. 6 by default. See Bootstrap grid system. If NULL, the card is full width.

overflow

Whether to set up a x and y overflow. FALSE by default. Useful in case the card contains large tables.

Author(s)

David Granjon, [email protected]

Examples

if(interactive()){
 library(shiny)
 library(tablerDash)

 shiny::shinyApp(
   ui = tablerDashPage(
    navbar = NULL,
    footer = NULL,
    title = "test",
    body = tablerDashBody(
     tablerCard(
      title = "Card",
      sliderInput("obs", "Number of observations:",
      min = 0, max = 1000, value = 500
      ),
      plotOutput("distPlot"),
      status = "success",
      statusSide = "left"
     )
    )
   ),
   server = function(input, output) {
   output$distPlot <- renderPlot({
    hist(rnorm(input$obs))
   })
  }
 )
}

Create a Boostrap 4 dashboard body

Description

Build a tabler dashboard body

Usage

tablerDashBody(...)

Arguments

...

Body content, slot for tablerTabItems.

Author(s)

David Granjon, [email protected]


Create a Boostrap 4 dashboard footer

Description

Build an adminLTE3 dashboard footer

Usage

tablerDashFooter(..., copyrights = NULL)

Arguments

...

Left text.

copyrights

Copyrights, if any.

Author(s)

David Granjon, [email protected]


Launch the tablerDash Gallery

Description

A gallery of all components available in tablerDash.

Usage

tablerDashGallery()

Examples

if (interactive()) {

 tablerDashGallery()

}

Create a Boostrap 4 dashboard navbar

Description

Build a tabler dashboard page

Usage

tablerDashNav(id, ..., src = NULL, navMenu = NULL)

Arguments

id

Navbar id.

...

Navbar content.

src

Brand image url or path.

navMenu

Slot for tablerNavMenu

Author(s)

David Granjon, [email protected]


Create a Boostrap 4 dashboard page

Description

Build a tabler dashboard page

Usage

tablerDashPage(
  navbar = NULL,
  body = NULL,
  footer = NULL,
  title = NULL,
  enable_preloader = FALSE,
  loading_duration = 2
)

Arguments

navbar

Slot for tablerDashNav.

body

Slot for tablerDashBody.

footer

Slot for tablerDashFooter.

title

App title.

enable_preloader

Whether to enable a page loader. FALSE by default.

loading_duration

Loader duration in seconds. 2s by default.

Author(s)

David Granjon, [email protected]

Examples

if(interactive()){
 library(shiny)
 library(tablerDash)

 shiny::shinyApp(
   ui = tablerDashPage(
    navbar = tablerDashNav(),
    footer = tablerDashFooter(),
    title = "test",
    body = tablerDashBody()
   ),
   server = function(input, output) {}
 )
}

Create a Boostrap 4 dashboard dropdown container

Description

Build a tabler dashboard dropdown container

Usage

tablerDropdown(..., icon = "bell", collapsed = TRUE)

Arguments

...

Slot for tablerDropdownItem.

icon

Dropdown icon.

collapsed

Whether to collapse the dropdown. TRUE by default.

Author(s)

David Granjon, [email protected]


Create a Boostrap 4 dashboard dropdown container

Description

Build a tabler dashboard dropdown container

Usage

tablerDropdownItem(
  ...,
  title = NULL,
  href = NULL,
  url = NULL,
  status = NULL,
  date = NULL
)

Arguments

...

Item content.

title

Item title.

href

External link.

url

Author image.

status

Item status. Only if url is not NULL.

date

Item date.

Author(s)

David Granjon, [email protected]


Create a Boostrap 4 icon

Description

Build a tabler icon

Usage

tablerIcon(name, lib = c("feather", "font-awesome", "payment"))

Arguments

name

Name of icon. See https://preview.tabler.io/icons.html for all valid icons.

lib

Icon library ("feather", "font-awesome", "payment").

Author(s)

David Granjon, [email protected]


Create a Boostrap 4 info card

Description

Build a tabler info card

Usage

tablerInfoCard(value, description = NULL, status, icon, href = NULL, width = 4)

Arguments

value

Card value.

description

Percentage increase/decrease.

status

Card status. See https://preview.tabler.io/docs/colors.html.

icon

Card icon.

href

External link.

width

Card width. 4 by default.

Author(s)

David Granjon, [email protected]

Examples

if(interactive()){
 library(shiny)
 library(tablerDash)

 shiny::shinyApp(
   ui = tablerDashPage(
    navbar = NULL,
    footer = NULL,
    title = "test",
    body = tablerDashBody(
     tablerInfoCard(
      value = "132 sales",
      status = "danger",
      icon = "dollar-sign",
      description = "12 waiting payments"
     )
    )
   ),
   server = function(input, output) {}
 )
}

Create a Boostrap 4 list container

Description

Build a tabler list container

Usage

tablerList(...)

Arguments

...

Slot for tablerListItem.

Author(s)

David Granjon, [email protected]

Examples

if(interactive()){
 library(shiny)
 library(tablerDash)

 shiny::shinyApp(
   ui = tablerDashPage(
    navbar = NULL,
    footer = NULL,
    title = "test",
    body = tablerDashBody(
      tablerCard(
       title = "tablerList",
       tablerList(
       tablerListItem(
        tablerTag(name = "Tag"),
        tablerTag(name = "Tag", href = "https://www.google.com"),
        tablerTag(name = "Tag", rounded = TRUE, color = "pink")
       ),
       tablerListItem(tablerStatus(color = "red")),
       tablerListItem(
        tablerAvatarList(
         stacked = TRUE,
         tablerAvatar(
           name = "DG",
           size = "xxl"
         ),
         tablerAvatar(
           name = "DG",
           color = "orange"
         ),
         tablerAvatar(
           name = "DG",
           status = "warning"
         ),
         tablerAvatar(url = "https://image.flaticon.com/icons/svg/145/145852.svg")
         )
        )
       )
      )
     )
   ),
   server = function(input, output) {}
 )
}

Create a Boostrap 4 list item

Description

Build a tabler list item

Usage

tablerListItem(...)

Arguments

...

Slot for any HTML element.

Author(s)

David Granjon, [email protected]


Create a Boostrap 4 media card

Description

Build a tabler media card

Usage

tablerMediaCard(
  ...,
  title = NULL,
  date = NULL,
  href = NULL,
  src = NULL,
  avatarUrl = NULL,
  width = 4
)

Arguments

...

Any other elements.

title

Title.

date

Date.

href

External link.

src

Image url.

avatarUrl

Avatar image.

width

Card width. 4 by default.

Author(s)

David Granjon, [email protected]

Examples

if(interactive()){
 library(shiny)
 library(tablerDash)

 shiny::shinyApp(
   ui = tablerDashPage(
    navbar = NULL,
    footer = NULL,
    title = "test",
    body = tablerDashBody(
     tablerMediaCard(
      title = "Media Card",
      date = "Today",
      href = "https://www.google.com",
      src = "https://preview.tabler.io/demo/photos/matt-barrett-339981-500.jpg",
      avatarUrl = "https://image.flaticon.com/icons/svg/145/145842.svg",
      width = 6
     )
    )
   ),
   server = function(input, output) {}
 )
}

Create a Boostrap 4 dashboard navbar menu

Description

Build a tabler dashboard main navbar menu

Usage

tablerNavMenu(...)

Arguments

...

Slot for tablerNavMenuItem.

Author(s)

David Granjon, [email protected]


Create a Boostrap 4 dashboard navbar menu item

Description

Build a tabler dashboard navbar menu item

Usage

tablerNavMenuItem(..., tabName = NULL, icon = NULL)

Arguments

...

Item name.

tabName

Should correspond exactly to the tabName given in tablerTabItem.

icon

Item icon.

Author(s)

David Granjon, [email protected]


Create a Boostrap 4 profile card

Description

Build a tabler profile card

Usage

tablerProfileCard(
  title = NULL,
  subtitle = NULL,
  background = NULL,
  src = NULL,
  socials = NULL,
  width = 4
)

Arguments

title

Profile title.

subtitle

Card subtitle.

background

Card background url or path.

src

User profile image.

socials

Slot for tablerSocialLinks and tablerSocialLink.

width

Card width. 4 by default.

Author(s)

David Granjon, [email protected]

Examples

if(interactive()){
 library(shiny)
 library(tablerDash)

 shiny::shinyApp(
   ui = tablerDashPage(
    navbar = NULL,
    footer = NULL,
    title = "test",
    body = tablerDashBody(
     tablerProfileCard(
      title = "Peter Richards",
      subtitle = "Big belly rude boy, million
      dollar hustler. Unemployed.",
      background = "https://preview.tabler.io/demo/photos/ilnur-kalimullin-218996-500.jpg",
      src = "https://preview.tabler.io/demo/faces/male/16.jpg",
      tablerSocialLinks(
       tablerSocialLink(
        name = "facebook",
        href = "https://www.facebook.com",
        icon = "facebook"
       ),
       tablerSocialLink(
        name = "twitter",
        href = "https://www.twitter.com",
        icon = "twitter"
       )
      )
     )
    )
   ),
   server = function(input, output) {}
 )
}

Create a Boostrap 4 progress bar

Description

Build a tabler progress bar

Usage

tablerProgress(value, status = NULL, size = NULL)

Arguments

value

Progress value.

status

Progress status. See https://preview.tabler.io/docs/colors.html.

size

Progress bar size: NULL, "xs", "sm", "md".

Author(s)

David Granjon, [email protected]

Examples

if(interactive()){
 library(shiny)
 library(tablerDash)

 shiny::shinyApp(
   ui = tablerDashPage(
    navbar = NULL,
    footer = NULL,
    title = "test",
    body = tablerDashBody(
      tablerProgress(value = 10, size = "xs"),
      tablerProgress(value = 90, status = "red", size = "sm")
     )
   ),
   server = function(input, output) {}
 )
}

Create a Boostrap 4 stat card

Description

Build a tabler stat card

Usage

tablerStatCard(value, title, trend = NULL, width = 3)

Arguments

value

Card value.

title

Card title.

trend

Percentage increase/decrease.

width

Card width. 3 by default.

Author(s)

David Granjon, [email protected]

Examples

if(interactive()){
 library(shiny)
 library(tablerDash)

 shiny::shinyApp(
   ui = tablerDashPage(
    navbar = NULL,
    footer = NULL,
    title = "test",
    body = tablerDashBody(
     tablerStatCard(
      value = 43,
      title = "Followers",
      trend = -10
     )
    )
   ),
   server = function(input, output) {}
 )
}

Create a Boostrap 4 status

Description

Build a tabler status

Usage

tablerStatus(color)

Arguments

color

Status color. See https://preview.tabler.io/docs/colors.html.

Author(s)

David Granjon, [email protected]

Examples

if(interactive()){
 library(shiny)
 library(tablerDash)

 shiny::shinyApp(
   ui = tablerDashPage(
    navbar = NULL,
    footer = NULL,
    title = "test",
    body = tablerDashBody(
     tablerStatus(color = "lime")
    )
   ),
   server = function(input, output) {}
 )
}

One tab to put inside a tab items container

Description

One tab to put inside a tab items container

Usage

tablerTabItem(tabName = NULL, ...)

Arguments

tabName

The name of a tab. This must correspond to the tabName of a tablerNavMenuItem.

...

Contents of the tab.


A container for tab items

Description

A container for tab items

Usage

tablerTabItems(...)

Arguments

...

Items to put in the container. Each item should be a tablerTabItem.


Create a Boostrap 4 table container

Description

Build a tabler table container

Usage

tablerTable(..., title = NULL, width = 4)

Arguments

...

Slot for tablerTableItem.

title

Card wrapper title.

width

Card wrapper width.

Author(s)

David Granjon, [email protected]

Examples

if(interactive()){
 library(shiny)
 library(tablerDash)

 shiny::shinyApp(
   ui = tablerDashPage(
    navbar = NULL,
    footer = NULL,
    title = "test",
    body = tablerDashBody(
       tablerTable(
        title = "tablerTable",
        tablerTableItem(
         left = tablerTag(name = "Tag"),
         right = tablerTag(name = "Tag", href = "https://www.google.com")
        ),
        tablerTableItem(right = tablerStatus(color = "red")),
        tablerTableItem(
         left = tablerAvatarList(
          stacked = TRUE,
          tablerAvatar(
           name = "DG",
           size = "xxl"
          ),
          tablerAvatar(
           name = "DG",
           color = "orange"
          ),
          tablerAvatar(
           name = "DG",
           status = "warning"
          ),
          tablerAvatar(url = "https://image.flaticon.com/icons/svg/145/145852.svg")
          )
         )
       )
     )
   ),
   server = function(input, output) {}
 )
}

Create a Boostrap 4 table item

Description

Build a tabler table item

Usage

tablerTableItem(left = NULL, right = NULL)

Arguments

left

Left elements.

right

Right elements.

Author(s)

David Granjon, [email protected]


Create a Boostrap 4 tag

Description

Build a tabler tag

Usage

tablerTag(
  name,
  href = NULL,
  rounded = FALSE,
  color = NULL,
  addon = NULL,
  addonColor = NULL
)

Arguments

name

Tag name.

href

Tag external link.

rounded

Whether the tag is rounded. FALSE by default.

color

Tag color. See https://preview.tabler.io/docs/colors.html.

addon

Tag addon (right side).

addonColor

Addon background color. See https://preview.tabler.io/docs/colors.html.

Author(s)

David Granjon, [email protected]

Examples

if(interactive()){
 library(shiny)
 library(tablerDash)

 shiny::shinyApp(
   ui = tablerDashPage(
    navbar = NULL,
    footer = NULL,
    title = "test",
    body = tablerDashBody(
     tablerTag(name = "Tag"),
     tablerTag(name = "Tag", href = "https://www.google.com"),
     tablerTag(name = "Tag", rounded = TRUE, color = "pink"),
     tablerTag(
      name = "npm",
      href = "https://www.google.com",
      color = "dark",
      addon = "passing",
      addonColor = "warning"
     ),
     tablerTag(name = "build", addon = "passing", addonColor = "success")
    )
   ),
   server = function(input, output) {}
 )
}

Create a Boostrap 4 tag list

Description

Build a tabler tag list

Usage

tablerTagList(...)

Arguments

...

Slot for tablerTag.

Author(s)

David Granjon, [email protected]

Examples

if(interactive()){
 library(shiny)
 library(tablerDash)

 shiny::shinyApp(
   ui = tablerDashPage(
    navbar = NULL,
    footer = NULL,
    title = "test",
    body = tablerDashBody(
     tablerTagList(
      lapply(X = 1:5, FUN = function(i) {
       tablerTag(name = i)
      })
     )
    )
   ),
   server = function(input, output) {}
 )
}

Create a Boostrap 4 timeline

Description

Build a tabler timeline

Usage

tablerTimeline(...)

Arguments

...

slot for tablerTimelineItem.

Author(s)

David Granjon, [email protected]

Examples

if(interactive()){
 library(shiny)
 library(tablerDash)

 shiny::shinyApp(
   ui = tablerDashPage(
    navbar = NULL,
    footer = NULL,
    title = "test",
    body = tablerDashBody(
     tablerTimeline(
      tablerTimelineItem(
       title = "Item 1",
       status = "green",
       date = "now"
      ),
      tablerTimelineItem(
       title = "Item 2",
       status = NULL,
       date = "yesterday",
       "Lorem ipsum dolor sit amet,
       consectetur adipisicing elit."
      )
     )
    )
   ),
   server = function(input, output) {}
 )
}

Create a Boostrap 4 timeline item

Description

Build a tabler timeline item

Usage

tablerTimelineItem(..., status = NULL, title, date)

Arguments

...

Item content.

status

Item status.

title

Item title.

date

Event date.

Author(s)

David Granjon, [email protected]