:また
actionButton("goButton", "", icon = icon("play-circle"))
、あなたはボタンのコードにアイコンを追加する機能icon()
を使用することができます。
tags$button(
id = "reset_button",
class="btn action-button",
icon("close")
)
それとも使用しますimg()
は自分自身を使用する機能を持っています:
tags$button(
id = "web_button",
class = "btn action_button",
img(src = "http://www.craftech.com/wp-uploads/2015/05/web.png",
height = "50px")
)
可能なアイコンのより包括的なリストを入手するには、shiny
パッケージの?icon
ヘルプページとSee Also
セクションのリンクをご覧ください。
例のアプリ:ここ
shinyApp(
ui = shinyUI(
fluidPage(
fluidRow(
actionButton("goButton", "", icon = icon("play-circle")),
tags$button(
id = "reset_button",
class="btn action-button",
icon("close")
),
tags$button(
id = "web_button",
class = "btn action-button",
tags$img(src = "http://images.all-free-download.com/images/graphicthumb/button_play_89677.jpg",
height = "50px")
)
),
fluidRow(
textOutput("text")
)
)
),
server = function(input, output, session){
out <- reactiveVal("Nothing")
observeEvent(input$goButton,{
out("Go Pushed")
})
observeEvent(input$reset_button,{
out("Resetted")
})
observeEvent(input$web_button,{
out("From the web")
})
output$text <- renderText({out()})
}
)
ありがとうございました!テキストを表示する必要はありません。私はロゴだけが必要です。私は自分のイメージをロゴ/アイコンとして使用する必要があります。 – MysticRenge
@MysticRengeラベルを '' "'に設定することで、ラベルを消すことができます。 –
@MysticRengeは、カスタム画像とボタンタグの使用方法の例を更新しました。 –