UI topics

Shiny

HTML basics, relevant for shiny

Author

Chi Zhang

Published

August 28, 2025

These are topics that are relevant for understand how the UI is made of.

library(htmltools) # imported by shiny
tagList(
  h1("Title"),
  h2("Header text"),
  p("Text here")
)

Title

Header text

Text here

tags$html(
  tags$head(
    tags$title('My first page')
  ),
  tags$body(
    h1('My first heading'),
    p('My first paragraph, with some ', strong('bold'), ' text.'),
    div(
      id = 'myDiv', 
      class = 'simpleDiv',
      'Here is a div with some attributes.'
     )
  )
)

My first heading

My first paragraph, with some bold text.

Here is a div with some attributes.