addHelpText: Adds a help icon to an input.

Description Usage Arguments Value Examples

View source: R/validated_input.R

Description

Internal function which adds a shinyreforms pop-up with help text to a shiny inputTag. The help text is a div which gets appended to the label for the given input.

Usage

1
addHelpText(tag, helpText, updated = FALSE)

Arguments

tag

A tag to be modified.

helpText

Help text to be added.

updated

An internal parameter which is used in recurrent calls to the function.

Value

A modified Shiny tag with a shinyreforms help icon.

Examples

1
2
3
4
addHelpText(
  shiny::textInput("text_input", label = "Label"),
  helpText = "Tooltip"
)

Example output

<div class="form-group shiny-input-container">
  <label class="control-label" for="text_input">
    Label
    <div class="shinyreforms-tooltip">
      <i class="glyphicon glyphicon-question-sign"></i>
      <div class="shinyreforms-tooltip-text">Tooltip</div>
    </div>
  </label>
  <input id="text_input" type="text" class="form-control" value=""/>
</div>

shinyreforms documentation built on July 2, 2020, 1:33 a.m.