inst/examples/render_epoxy/app.R

# Generated from example in render_epoxy(): do not edit by hand
library(shiny)
library(epoxy)

# to provide the HTML template and `render_epoxy()` to
# update the current time every second.

ui <- shiny::fluidPage(
	shiny::h2("Current Time"),
	ui_epoxy_html(
		"time",
		shiny::p("The current time is {{strong time}}.")
	)
)

server <- function(input, output, session) {
	current_time <- shiny::reactive({
		shiny::invalidateLater(1000)
		strftime(Sys.time(), "%F %T")
	})

	output$time <- render_epoxy(time = current_time())
}

shiny::shinyApp(ui, server)

Try the epoxy package in your browser

Any scripts or data that you put into this service are public.

epoxy documentation built on Sept. 20, 2023, 1:06 a.m.