shinyGizmo fills the gaps between what Shiny offers out of the box and what real-world applications need. It provides ready-to-use components that give you finer control over inputs, keep large applications responsive and let you build dynamic, adaptive interfaces - all from R, without writing JavaScript.
update* call, block unwanted updates, or grab any DOM value
on demand.From CRAN:
install.packages("shinyGizmo")
Latest development version from Github:
remotes::install_github(
"r-world-devs/shinyGizmo"
)
Decide when and how input values reach the server.
commonInput(s)
- merge multiple input controllers into one
controlInput
- control how input value is sent to the serverWrap any input controller to find out whether its value was changed
by the user or programmatically (with update* functions),
block sending the value depending on the change source, or attach custom
attributes to the value.
ui <- fluidPage(
controlInput(selectInput("letter", "Letter", letters), attributes = list(group = "form")),
controlInput(numericInput("number", "Number (program updates blocked)", value = 1), block = "program"),
controlInput(dateInput("date", "Date (user changes blocked)", value = Sys.Date()), block = "user"),
actionButton("update", "Update programmatically"),
verbatimTextOutput("out")
)
server <- function(input, output, session) {
output$out <- renderPrint({
str(list(letter = input$letter, number = input$number, date = input$date))
cat("Date trigger:", attr(input$date, "trigger"))
})
observeEvent(input$update, {
updateSelectInput(session, "letter", selected = sample(letters, 1))
updateNumericInput(session, "number", value = sample(1:10, 1))
updateDateInput(session, "date", value = Sys.Date() + sample(1:10, 1))
})
}
The "trigger" attribute is one of "init",
"user" or "program". Original input handlers
are still applied, so e.g. dateInput value is a
Date object. See examples/controlinput.R for
the full app.
valueButton
- get any attribute from Shiny application DOM objects
Controllers not available in Shiny.
pickCheckboxInput
and vsCheckboxInput - make selection in many groups at
once

textArea
- non-binding version of shiny::textAreaInput.
Improves application performance when large amount text is passed to
text area. Works great with valueButton.
Structure the application UI.
container
+ grid - responsive layouts with CSS Container Queries
Build responsive layouts that adapt based on the container’s own
dimensions rather than the viewport using CSS
Container Queries and CSS
Grid Layout. Combine container() with
condition() to define CSS rules at different breakpoints,
and use grid() / grid_item() as composable
helpers for CSS Grid layouts.
container(
name = "dashboard",
color = "#b5c5e7ff",
div(class = "sidebar", "Sidebar", style = "background-color:#d4f89b;") |> grid_item(area = "sidebar"),
div(class = "main", "Main content", style = "background-color:#b5c5e7;") |> grid_item(area = "main"),
conditions = list(
condition(
!!!grid(
template_areas = list(c("sidebar", "main")),
template_columns = "200px 1fr",
gap = "16px"
),
`font-size` = "20px"
),
condition(
query = "width < 700px",
!!!grid(
template_areas = list(c("sidebar"), c("main")),
gap = "12px"
),
`font-size` = "12px"
)
)
)Key features:
container() - wraps elements with
container-type / container-name for CSS
Container Queriescondition() - defines CSS rules for a
specific container query (or unconditionally when
query = NULL); supports .extra_css for
targeting child selectorsgrid() - generates CSS Grid properties
(template_areas, template_columns,
auto_fill, etc.) as a named list for splicing into
condition() via !!!grid_item() - pipe-friendly helper to
set grid-area, grid-row,
grid-column on individual elementsSee examples/container.R for a full demo app with nested
containers, auto-fill grids, and explicit row/column spanning.
accordion
- light and simple version of accordion

modalDialogUI
- create modals directly in UI
Change UI on the browser side, based on application state.
conditionalJS
- extended version of shiny::conditionalPanel.Allows to attach conditional JavaScript action to be run on UI element.
Use predefined actions such as disable,
attachClass, css, show,
runAnimation or define a custom one.

Attach multiple rules to a single element by applying
conditionalJS multiple times, or by passing vectors of
conditions and calls:
tags$button("Bold when value at least 5, disabled when locked") |>
conditionalJS("input.value >= 5", jsCalls$attachClass("boldme")) |>
conditionalJS("input.lock", jsCalls$disable())
conditionalJS(
tags$button("Visible when value at least 3, red when at least 7"),
condition = c("input.value >= 3", "input.value >= 7"),
jsCall = list(jsCalls$show(), jsCalls$css(color = "red"))
)shinyGizmo is stable but we’re still developing the package. If you find bugs or have any suggestions for future releases post an issue on GitHub page at https://github.com/r-world-devs/shinyGizmo/issues.
There are two main ways to get help with shinyGizmo