Input Group

Description

Create an input with addons such as icons, buttons, or text.

Usage

bc_input_group(..., orientation = "default", aria_label = NULL, class = NULL)

bc_input_group_addon(..., align = "start", aria_hidden = FALSE)

Arguments

Argument Description
... For bc_input_group(), the input and its addons from bc_input_group_addon(). For bc_input_group_addon(), the addon's content.
orientation String. "default" for addons beside the input, or "vertical" for rows above and below it.
aria_label String. Accessible name for the group.
class String. Extra CSS classes.
align String. Where the addon sits. One of start, end, inline-start, inline-end, block-start, block-end.
aria_hidden Bool. Hide the addon from screen readers. Defaults to FALSE.

Value

An htmltools tag.

Details

Rows above and below the input, made with tags$header() and tags$footer(), need orientation = "vertical".

Examples

bc_input_group(
  bc_input(type = "search", placeholder = "Search...", aria_label = "Search"),
  bc_input_group_addon(bc_kbd("\u2318K"), align = "end")
)
⌘K

bc_input_group(
  htmltools::tags$textarea(placeholder = "Enter your message"),
  htmltools::tags$footer(
    `data-align` = "end",
    htmltools::span("120 characters left")
  ),
  orientation = "vertical"
)
120 characters left