| a11y_textInput | R Documentation |
A wrapper for shiny::textInput() with ARIA attributes according to
BITV 2.0, enforced visible label, optional heading annotation, custom CSS
class, and sr-only description support.
a11y_textInput(
inputId,
label,
value = "",
width = NULL,
placeholder = NULL,
...,
describedby = NULL,
describedby_text = NULL,
heading_level = NULL,
aria_controls = NULL
)
inputId |
Input ID |
label |
Visible label (required) |
value |
Initial text value (default: |
width |
Control width (optional) |
placeholder |
Placeholder text (optional) |
... |
Additional arguments for |
describedby |
ID of an element for |
describedby_text |
Creates an sr-only |
heading_level |
1–6, marks the visible |
aria_controls |
(optional) ARIA controls attribute |
HTML tag of the input component (possibly with sr-only description)
# Basic text input
a11y_textInput("name", "Full name")
# With placeholder and screen-reader description
a11y_textInput("email", "E-mail address",
placeholder = "user@example.com",
describedby_text = "We will never share your e-mail"
)
# With heading-level annotation (for sectioned forms)
a11y_textInput("company", "Company name",
heading_level = 3
)
# Linking to an existing description element via its ID
a11y_textInput("query", "Search query",
describedby = "query_help"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.