×
注意!页面内容来自https://ericrayanderson.github.io/shinymaterial/,本站不储存任何内容,为了更好的阅读体验进行在线解析,若有广告出现,请及时反馈。若您觉得侵犯了您的利益,请通知我们进行删除,然后访问 原网页
library(shiny)
library(shinymaterial)
# Wrap shinymaterial apps in material_page
ui <- material_page(
title = "Basic Page",
tags$h1("Page Content")
)
server <- function(inputoutput) {
}
shinyApp(ui = uiserver = server)
library(shiny)
library(shinymaterial)
# Wrap shinymaterial apps in material_page
ui <- material_page(
title = "Basic Page + Parallax",
# Typically the image will be placed in a folder labeled 'www'
# at the same level as the application (server.R & ui.R)
material_parallax(
image_source =
"https://upload.wikimedia.org/wikipedia/commons/thumb/8/8d/Freudenberg_sg_Switzerland.jpg/1920px-Freudenberg_sg_Switzerland.jpg"
),
tags$h1("Page Content")
)
server <- function(inputoutput) {
}
shinyApp(ui = uiserver = server)
material_card(
title =
"Miles Per Gallon Density",
plotOutput("mpg_density")
)
material_button(
input_id = "example_button",
label = "BUTTON",
depth = 5
)
material_card(
title = "Card",
depth = 5,
plotOutput("mpg_density")
)
material_button(
input_id = "example_button",
label = "BUTTON"
)
material_dropdown(
input_id = "example_dropdown",
label = "Dropdown",
choices = c(
"Chicken" = "c",
"Steak" = "s",
"Fish" = "f"
),
selected = "s"
)
material_button(
input_id = "example_button",
label = "DEEP_ORANGE",
color = "deep-orange"
)
material_modal(
modal_id = "example_modal",
button_text = "Modal",
button_icon = "open_in_browser",
title = "Showcase Modal Title",
tags$p("Modal Content")
)
material_parallax(
# Image in a folder labeled "www"
image_source = "trains.jpg"
)
library(shiny)
library(shinymaterial)
ui <- material_page(
title = "Spinner Example",
numericInput(inputId = "n"label = ""value = 10),
plotOutput("n_plot")
)
server <- function(inputoutputsession) {
output$n_plot <- renderPlot({
#--- Show the spinner ---#
material_spinner_show(session"n_plot")
#--- Simulate calculation step ---#
Sys.sleep(time = 5)
#--- Hide the spinner ---#
material_spinner_hide(session"n_plot")
plot(1:input$n)
})
}
shinyApp(ui = uiserver = server)
material_page(
title = "Basic Page"
primary_theme_color = "blue"
secondary_theme_color = "red",
material_row(
material_column(
width = 12,
material_button("button""Button"),
material_switch("switch""""off""on"),
material_radio_button("radio"""c("A""B""C"))
)
)
)