Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Extend the header and footer for teal to include interactive elements #1429

Open
3 tasks done
vedhav opened this issue Dec 12, 2024 · 0 comments
Open
3 tasks done
Labels
core enhancement New feature or request

Comments

@vedhav
Copy link
Contributor

vedhav commented Dec 12, 2024

Feature description

Currently, it is not easy to create header and footer with custom server logic, one can only create static header and footers in teal easily.

The way to make them interactive is to manually modify the server function like this:

library(teal)

app <- init(
  data = teal_data(IRIS = iris, MTCARS = mtcars),
  modules = modules(example_module()),
  header = tags$div(actionButton("click_me", "Click Me!"), textOutput("click_count")),
  footer = tags$div("Static footer")
)

body(app$server)[[length(body(app$server)) + 1]] <- quote(
  output$click_count <- renderText({
    paste("You clicked the button", input$click_me, "times")
  })
)

shinyApp(app$ui, app$server)

It will be nice if we can provide the server logic in an easy way so we can create header and footers with interactivity.

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant