using plain html within a shiny-ui-app throws an error

I am very new here. First I want to understand how to do best.
In moment I want to include a little part of plain html in my ui.r script

[...]

,
               div(
                id="panelsStayOpen-collapseOne",
                class="accordion-collapse collapse show",
                div(
                 class="accordion-body",
                 html("<strong>This is the first item's accordion body.</strong>"),
                )
               ),

[...]

The result is an error-message :

# An error has occurred!
could not find function "html"

I don't understand why - I thought html is a nativ shiny function?

Hi there,
I guess you want to use the HTML function (upper case):

library(shiny)

ui <- fluidPage(
  div(
    id="panelsStayOpen-collapseOne",
    class="accordion-collapse collapse show",
    div(
      class="accordion-body",
      HTML("<strong>This is the first item's accordion body.</strong>")
    )
  )
)

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

shinyApp(ui, server)

Also check this related article.

Thank you, very much. It's the little things that are so easily overlooked.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.