# NOT RUN {
### A simple button
buttonInput(
id = "button1",
label = "Simple"
)
# Alternatively, a button can fill the width of its parent element.
buttonInput(
id = "button2",
label = "Full-width",
fill = TRUE # <-
) %>%
background("red")
# Use design utilities to further adjust the width of a button.
buttonInput(
id = "button3",
label = "Full and back again",
fill = TRUE # <-
) %>%
background("red") %>%
width("3/4") # <-
### Possible colors
colors <- c(
"red", "purple", "indigo", "blue", "cyan", "teal", "green",
"yellow", "amber", "orange", "grey"
)
lapply(
colors,
function(color) {
buttonInput(
id = color,
label = color
) %>%
background(color) %>%
margin(2)
}
) %>%
div() %>%
display("flex") %>%
flex(wrap = TRUE)
### Reactive links
div("Curabitur ", linkInput("link1", "vulputate"), " vestibulum lorem.")
### Stretched buttons and links
card(
header = "Card with stretched button",
p("Notice when you hover over the card, the button also detects ",
"the hover."),
buttonInput(
id = "go",
label = "Go go go",
stretch = TRUE
) %>%
background("blue")
) %>%
width(20)
### Download button
buttonInput(
download = TRUE,
id = "download1",
label = "Download",
icon("download")
)
# }
Run the code above in your browser using DataLab