How to change icon position using bsButton

shiny
rstudio

#1

Hi, I'm trying to add a "question" icon next to a box title so that when click or hover the icon, I can have a explanation of the title using bsPopover.

How can I change the position of that icon? Now it is showing on top left of the first box, what I want to explain is the second box.

dashboardBody<- dashboardBody(
  
 bsButton(
    inputId="input2",
    label = ",",
    icon = icon("question"),
    style = "info",
    size = "extra-small"
),
  bsPopover(
    id="input2",title="Popover Title",
    content="Here shows the content",
    trigger="hover",
    placement="left",
    options=list(container="body")
  ),

  tabItem(tabName = "overview",
           fluidRow(
            
           box(
              id="input1",
              title = tagList(icon=icon("bell"), "Box Title1"),
              plotOutput("plot1")
            ),

            box(
              id="input2",
              title = tagList(icon=icon("bell"), "Box Title2"),
              plotOutput("plot2")
            )
 ))
)

ui<- dashboardPage(
  dashboardHeader,
  dashboardSidebar,
  dashboardBody)
 
server<- function(input, output) {

output$plot1<-renderPlot(
ggplot(...)
),

output$plot2<-renderPlot(
ggplot(...)
)

#2

Hi there, and welcome to community.rstudio.com! It's a little difficult to work with the code you've presented here. Can you please share a reprex (reproducible example)? This will ensure we're all looking at the same data and code. A guide for creating a reprex can be found here.

Generally, I'd recommend using fluidColumn() in your layout to create a 'home' for your icon.