The element embedded into the Shiny input will be pulled to the right edge of the label.
shinyInput_label_embed(tag, element)
Shiny input, such as shiny::[numericInput][shiny::numericInput]
htmltools::[tag][htmltools::tag]
to be embedded
into label of tag
Shiny input, modified copy of tag
To promote consistency, the following convention is proposed:
For links (activated by clicking), embed a shiny::icon("info-circle")
;
this is the default for shiny_iconlink()
. For elements activated
by hovering, embed a shiny::icon("info")
.
library("shiny")
numericInput(inputId = "foo", label = "Enter a number", value = 0) %>%
shinyInput_label_embed(
shiny_iconlink() %>%
bs_embed_popover(title = "Number", content = "Not a complex number")
)
#> <div class="form-group shiny-input-container">
#> <label class="control-label" id="foo-label" for="foo" style="width:100%;">
#> Enter a number
#> <div class="pull-right">
#> <a href="#" title="Number" data-toggle="popover" data-content="Not a complex number" data-placement="top">
#> <i class="fas fa-circle-info" role="presentation" aria-label="circle-info icon"></i>
#> </a>
#> </div>
#> </label>
#> <input id="foo" type="number" class="form-control" value="0"/>
#> </div>