我正在使用shinyWidgets
的闪亮应用程序中的所有按钮。我还使用了fileInput按钮,我希望此按钮的样式与我的shinyWidgets::actionBttn
相同。有办法吗?
library(shiny)
library(shinyWidgets)
shinyUI(fluidPage(
# Application title
titlePanel("Uploac a file"),
fileInput("Myfile",label="",multiple = FALSE),br(),
actionBttn("textPrep",label = "Browse")
))
答案 0 :(得分:1)
您可以执行以下操作:
library(shiny)
library(shinyWidgets)
library(shinyjs)
ui <- fluidPage(
useShinyjs(),
# Application title
titlePanel("Upload a file"),
fileInput("Myfile", label="", multiple = FALSE),
br(),
actionBttn("textPrep", label = "Browse")
)
server <- function(input, output){
addCssClass(class = "bttn bttn-unite bttn-default bttn-no-outline",
selector = ".btn-file")
}
shinyApp(ui, server)