Learn R Programming

shinyChakraUI (version 1.1.1)

jseval: Evaluate JS code

Description

Evaluate JavaScript code in the application.

Usage

jseval(code)

Arguments

code

JavaScript code given as a string

Value

A list containing the URL-encoded JavaScript code.

Examples

Run this code
# NOT RUN {
library(shiny)
library(shinyChakraUI)

ui <- chakraPage(

  br(),

  chakraComponent(
    "mycomponent",

    Tag$Button(
      colorScheme = "pink",
      size = "lg",
      onClick = jseval('() => alert("Hello Chakra")'),
      "Trigger alert"
    )

  )

)

server <- function(input, output, session){}

if(interactive()){
  shinyApp(ui, server)
}
# }

Run the code above in your browser using DataLab