'Add coloured circle inside the text of an input element label (in Shiny)

I have a checkBox input element in Shiny Dashboard.

How to add a geometric shape (such as a circle) inside a label of an input element (e.g. a checkBox). I would also like to be able to modify the size and the colour of the circle independently of the font size of the text that goes before or after the circle.



Solution 1:[1]

This might get you started:

library(shiny)

ui <- fluidPage(
  tags$style(HTML(".icon-style {color:#E87722;}")),
  checkboxInput("test", label = span("Test", icon("circle", class = "icon-style")), value = TRUE),
  checkboxInput("test", label = span("Test", icon("circle", class = "icon-style fa-3x")), value = TRUE)
)

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

shinyApp(ui, server)

Also see this related article.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ismirsehregal