闪亮的actionButton

时间:2020-11-12 15:30:54

标签: r shiny action-button

嗨,我正在尝试在闪亮的按钮上放置一个操作按钮,我的代码如下

library(shiny)
library(shinyjs)
library(shinyWidgets)


shinyApp(
  ui = shinyUI(fluidPage(useShinyjs(),setBackgroundColor("black"),
    actionButton("button", "don't press the button", icon("paper-plane"), 
    style="color: #fff; background-color: #000000; border-color: #FF0000"),
    hidden(
      div(id='text_div',
        verbatimTextOutput("text")
        )
    )
  )
  ),
  server = function(input, output, session){
    observeEvent(input$button, {
      toggle('text_div')
      output$text <- renderText({"ahh you pressed it"})
    })

  }
)

一切正常,除了在我运行文档时,按钮落入一个巨大的框内,而我只是想成为按钮。 我将添加一些图片,以更好地解释它:

我有这个:https://i.stack.imgur.com/zmtXR.jpg

我想要这个:https://i.stack.imgur.com/t5L3Y.jpg

0 个答案:

没有答案