rshinytabsnavbar

How to divide two words that appear in navigation bar tabs?


I am trying to make two lines of the words that appear in each tab, in navigation bar but cannot in any way.

Here it is the pics with the words I am trying to divide in two lines.

And here is a snippet of a code in r script

 gene_expressions_sign_tab <- shiny::tabPanel(
      "Gene Expression",
      icon = icon("chart-line"),
      value = "Gene",
      wellPanel(
        fluidRow("etc")

############################################################################Adding extra info after I have been given an answer below ########################################################################### And it possible to get the two words in two lines in one tab, is it possible to centre the words? the picture reveals the fact the words aren't centered.

enter image description here


Solution

  • Use HTML and embed <br/> in your titles.

    library(shiny)
    shinyApp(
      ui = fluidPage(
        tabsetPanel(
          tabPanel(HTML("hello<br/>world")),
          tabPanel(HTML("hello<br/>again"))
        )
      ),
      server = function(input, output, session) {}
    )
    

    enter image description here