Input
Description
Create a text input with an optional label and helper text.
Usage
bc_input(
...,
label = NULL,
id = NULL,
type = "text",
placeholder = NULL,
description = NULL,
value = NULL,
name = id,
required = FALSE,
disabled = FALSE,
invalid = FALSE,
aria_label = NULL
)
Arguments
| Argument | Description |
|---|---|
... |
Extra tag attributes for the input. |
label |
String or tag. The label. |
id |
String. The input ID. Required when label is set. |
type |
String. The input type, such as "email" or "password". Defaults to "text". |
placeholder |
String. Placeholder text. |
description |
String or tag. Helper text shown under the input. Needs a label. |
value |
String. The starting value. |
name |
String. The input name. Defaults to id. |
required |
Bool. Whether the input is required. Defaults to FALSE. |
disabled |
Bool. Whether the input is disabled. Defaults to FALSE. |
invalid |
Bool. Whether to show the invalid state. Defaults to FALSE. |
aria_label |
String. Accessible name for the input. Set it when there is no label, since a placeholder doesn't count. |
Value
An htmltools tag.
Examples
bc_input(type = "email", placeholder = "Email", aria_label = "Email")
bc_input(
id = "email",
label = "Email",
type = "email",
placeholder = "m@example.com",
description = "Enter your email address."
)
Enter your email address.