% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/widgets.R
\name{back_top_button}
\alias{back_top_button}
\title{'HTML' code to generate small back-to-top button}
\usage{
back_top_button(
  icon = "chevron-up",
  title = "Jump to",
  open_drawer = TRUE,
  drawer_icon = "ellipsis"
)
}
\arguments{
\item{icon}{the icon for back-to-top button}

\item{title}{the expanded menu title}

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

\item{drawer_icon}{the icon for the drawer-toggle button;
defaults to \code{"ellipsis"} (three dots). Use e.g.
\code{"robot"} for AI-agent modules.}
}
\value{
'HTML' tags
}
\description{
This function is a template function that should be called
in 'HTML' templates before closing the \code{"</body>"} tag.

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

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

}
