| app | R Documentation |
Create an application
app(
...,
bindings = list(),
actions = list(),
title = NULL,
mouse = TRUE,
stylesheet = NULL,
theme = "default",
debug = FALSE,
reduce_motion = NULL
)
... |
Widgets to show, plus optional |
bindings |
A list of |
actions |
A named list of action functions |
title |
Optional title. |
mouse |
Enable mouse input (clicks, wheel, hover)? |
stylesheet |
A |
theme |
A |
debug |
Bind F12 to a debug overlay (focused and hovered widget, last event, repaint statistics)? |
reduce_motion |
Turn decorative animation off? |
An App. Start it with run().
Built-in bindings: tab / shift+tab move focus, ctrl+c quits.
hello <- app(
vertical(
label("What is your name?"),
input(id = "name"),
button("Say hello", id = "hello"),
label("", id = "output")
),
on("button.pressed", "#hello", function(event, app) {
name <- app$query_one("#name")$value
app$query_one("#output")$update(paste("Hello", name))
}),
bind("escape", "quit")
)
if (interactive()) run(hello)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.