tests/testthat/apps/epoxy-html-list/app.R

library(shiny)
library(epoxy)

ui <- fixedPage(
	sliderInput("n", "Letters", 1, 26, 3),
	p(
		"data-test-id" = "desc",
		ui_epoxy_html("desc", "You've picked {{n}} {{thing}}:")
	),
	tags$ul(
		"data-test-id" = "list",
		ui_epoxy_html("list", "{{item}}", .item_tag = "li")
	)
)

server <- function(input, output, session) {
	output$list <- render_epoxy(
		item = letters[1:input$n]
	)

	output$desc <- render_epoxy(
		n = input$n,
		thing = if (input$n == 1) "letter" else "letters"
	)
}

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.