Some Fomantic UI elements require to run a specific JS code when DOM document is ready. There are at least 2 options to do this:
shinyjs
library(shinyjs)
...<- " # Fomantic UI componts JS "
jsCode
...<- function() {
ui shinyUI(
semanticPage(
title = "Your page title",
::useShinyjs(),
shinyjs# Your UI code
)
)
}<- shinyServer(function(input, output) {
server runjs(jsCode)
# Your Shiny logic
})shinyApp(ui = ui(), server = server)
shiny::tags$script()
...<- "
jsCode $(document).ready(function() {
# Semantic UI components JS code, like:
#$('.rating').rating('setting', 'clearable', true);
#$('.disabled .rating').rating('disable');
})
...
"
<- function() {
ui shinyUI(
semanticPage(
title = "My page",
$script(jsCode),
tags# Your UI code
)
)
}
...<- shinyServer(function(input, output) {
server # Your Shiny logic
})
shinyApp(ui = ui(), server = server)