action_button: Action button

Description Usage Arguments Examples

View source: R/button.R

Description

Creates an action button whose value is initially zero, and increments by one each time it is pressed.

Usage

1
2
3

Arguments

input_id

The input slot that will be used to access the value.

label

The contents of the button - a text label, but you could also use any other HTML, like an image.

icon

An optional icon to appear on the button.

width

The width of the input.

...

Named attributes to be applied to the button or remaining parameters passed to button, like class.

inputId

the same as input_id

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
if (interactive()){
library(shiny)
library(shiny.semantic)
ui <- shinyUI(semanticPage(
  actionButton("action_button", "Press Me!"),
  textOutput("button_output")
))
server <- function(input, output, session) {
  output$button_output <- renderText(as.character(input$action_button))
}
shinyApp(ui, server)
}

shiny.semantic documentation built on Nov. 7, 2021, 5:07 p.m.