| a11y_textButtonGroup | R Documentation |
A composite component combining a11y_textInput() and
a11y_actionButton() with BITV 2.0-conform ARIA attributes. The text input
enforces a visible label; the button enforces either a visible label or an
aria-label. By default the button gets aria-controls pointing to the
text input.
a11y_textButtonGroup(
textId,
buttonId,
label,
value = "",
placeholder = NULL,
button_label = NULL,
button_icon = NULL,
button_aria_label = NULL,
controls = NULL,
layout = c("inline", "stack"),
text_describedby = NULL,
text_describedby_text = NULL,
text_heading_level = NULL
)
textId |
ID for the inner text input (required) |
buttonId |
ID for the inner action button (required) |
label |
Visible label for the text input (required) |
value |
Initial value for the text input (default: |
placeholder |
Placeholder for the text input (optional) |
button_label |
Visible label for the button (optional; if omitted/empty,
|
button_icon |
Icon for the button (e.g. |
button_aria_label |
ARIA label for the button (required if
|
controls |
ID referenced by |
layout |
|
text_describedby |
ID for |
text_describedby_text |
Creates an sr-only |
text_heading_level |
1–6, marks the visible |
HTML tag containing the labeled text input and button
# Search box with icon-only button
a11y_textButtonGroup(
textId = "search_text",
buttonId = "search_btn",
label = "Search",
placeholder = "Enter a keyword",
button_icon = shiny::icon("search"),
button_aria_label = "Run search"
)
# Stacked layout with visible button label
a11y_textButtonGroup(
textId = "comment_text",
buttonId = "comment_btn",
label = "Comment",
button_label = "Send",
layout = "stack"
)
# With screen-reader description and heading-level on the label
a11y_textButtonGroup(
textId = "query_text",
buttonId = "query_btn",
label = "Search query",
placeholder = "Enter a keyword",
button_icon = shiny::icon("search"),
button_aria_label = "Run search",
text_describedby_text = "Type a keyword and press the search button",
text_heading_level = 3
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.