back_top_button: 'HTML' code to generate small back-to-top button

View source: R/widgets.R

back_top_buttonR Documentation

'HTML' code to generate small back-to-top button

Description

This function is a template function that should be called in 'HTML' templates before closing the "</body>" tag.

When open_drawer = TRUE, an additional button is rendered that fires a "button.click" shidashi-event with type = "open_drawer". Module server code (or chatbot_server) can observe this event via get_event and call drawer_open / shiny::renderUI to fill the drawer with content.

Usage

back_top_button(
  icon = "chevron-up",
  title = "Jump to",
  open_drawer = TRUE,
  drawer_icon = "ellipsis"
)

Arguments

icon

the icon for back-to-top button

title

the expanded menu title

open_drawer

logical; whether to include a drawer-toggle button. Defaults to TRUE if a .shidashi-drawer element will be present in the page (e.g.\ from module_drawer()).

drawer_icon

the icon for the drawer-toggle button; defaults to "ellipsis" (three dots). Use e.g. "robot" for AI-agent modules.

Value

'HTML' tags

Examples


back_top_button()
back_top_button("rocket")
back_top_button("rocket", drawer_icon = "robot")


shidashi documentation built on April 10, 2026, 5:07 p.m.