https://github.com/ashbaldry/shinytitle
Window Title Change in Shiny
https://github.com/ashbaldry/shinytitle
Last synced: 5 months ago
JSON representation
Window Title Change in Shiny
- Host: GitHub
- URL: https://github.com/ashbaldry/shinytitle
- Owner: ashbaldry
- Created: 2021-05-25T19:57:36.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-15T17:54:17.000Z (almost 4 years ago)
- Last Synced: 2024-10-28T17:32:19.004Z (6 months ago)
- Language: R
- Size: 396 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - ashbaldry/shinytitle - Window Title Change in Shiny (R)
README
# `shinytitle` - Window Browser Title Change in Shiny
[](https://github.com/ashbaldry/shinytitle/actions)
The goal of `shinytitle` is to update the browser window title when running a shiny application.## Installation
```r
devtools::install_github("ashbaldry/shinytitle")
```## Functionality
Currently there are three functions:
- `change_window_title`: Make a single change to the window title
- `flashing_window_title`: Make the window title flash between the current title and a temporary second title, and
- `busy_window_title`: Adding the ability to change the browser title to a different string whenever the shiny app is busy## Examples

### Written Example
```r
library(shiny)
library(shinytitle)
ui <- fluidPage(
title = "Initial Title",
use_shiny_title(),
actionButton("button", "Click me for a flashing title"),
actionButton("button2", "Click me for a new title after a 3 second wait")
)
server <- function(input, output, session) {
observeEvent(input$button, {
flashing_window_title(session, "--- Flashing Title ---", duration = 10000)
})
observeEvent(input$button2, {
Sys.sleep(3)
change_window_title(session, "Sleep Finished", inactive_only = TRUE)
})
}
shinyApp(ui, server)
```