inst/app/ui/button_style.R

#' @export
my_button <- function(inputId, label = NULL, icon = NULL, style = "unite",
                      color = "default", size = "md", block = FALSE,
                      no_outline = TRUE){
  
  value <- shiny::restoreInput(id = inputId, default = NULL)
  
  attach_dep <- function(tag){
    
    dep <- htmltools::htmlDependency(
      name = hs.balancedata,
      version = '0.1.2',
      stylesheet = "button-styles.css"
    )
    
    htmltools::attachDependencies(tag, dep, append = TRUE)
  }
  
  tag_button <- htmltools::tags$button(
    id = inputId, type = "button", class = "action-button bttn", `data-val` = value,
    class = 'btn left',
    class = 'slant-left',
    class = 'right title'
  )
  
  attach_dep(tag_button)
  
}
aljrico/hs_balancedata documentation built on Dec. 3, 2019, 5:47 p.m.