Skip to contents

This function create a text area input.

Usage

text_area_Input(
  inputId,
  label,
  hint_label = NULL,
  row_no = 5,
  error = FALSE,
  error_message = NULL,
  word_limit = NULL
)

Arguments

inputId

The id assigned to the component's root element. For Shiny input components this is also the name used to access the value via input$<inputId>.

label

Display label for the control, or NULL for no label. Accepts a plain character string, an HTML string, or shiny tag objects such as shiny::tags$b("Bold") or a shiny::tagList().

hint_label

Display hint label for the control, or NULL for no hint label. Accepts the same rich content as label, so it can include a link.

row_no

Size of the text entry box. Defaults to 5

error

If TRUE, render the component in its error state and reserve a slot for the error message. Defaults to FALSE.

error_message

Text shown when error is TRUE. Defaults to NULL.

word_limit

Add a word limit to the display. Defaults to NULL

Value

a text area box HTML shiny tag object

Examples

text_area_Input(
  "taId",
  "Can you provide more detail?",
  paste(
    "Do not include personal or financial information, like your",
    "National Insurance number or credit card details."
  )
)
#> <div class="govuk-form-group" id="taIddiv">
#>   <label class="govuk-label" for="taId">Can you provide more detail?</label>
#>   <div class="govuk-hint" id="taId-hint">Do not include personal or financial information, like your National Insurance number or credit card details.</div>
#>   <textarea id="taId" class="govuk-textarea" rows="5" aria-describedby="taId-hint"></textarea>
#> </div>

# Rich content: a link in the hint
text_area_Input(
  "taId2",
  "Can you provide more detail?",
  shiny::tagList(
    "Read the ",
    shinyGovstyle::external_link("https://www.gov.uk", "guidance on detail")
  )
)
#> <div class="govuk-form-group" id="taId2div">
#>   <label class="govuk-label" for="taId2">Can you provide more detail?</label>
#>   <div class="govuk-hint" id="taId2-hint">
#>     Read the <a href="https://www.gov.uk" class="govuk-link" target="_blank" rel="noopener noreferrer">guidance on detail (opens in new tab)</a></div>
#>   <textarea id="taId2" class="govuk-textarea" rows="5" aria-describedby="taId2-hint"></textarea>
#> </div>