Checkbox
Description
A checkbox input paired with its label in a Basecoat field.
Usage
bc_checkbox(
id,
label,
...,
checked = FALSE,
disabled = FALSE,
invalid = FALSE,
description = NULL,
name = id
)
Arguments
| Argument | Description |
|---|---|
id |
String. The input id, and the for of its label. |
label |
String or tag. The label content. |
... |
Attributes passed to the <input>. |
checked |
Bool. Whether the box starts ticked. |
disabled |
Bool. Whether the box is disabled. |
invalid |
Bool. Whether to show the invalid state. |
description |
String or tag. Helper text shown under the label, wired to the input with aria-describedby. |
name |
String. The input name, defaulting to id. |
Value
A <div> tag.
Examples
bc_checkbox("terms", "Accept terms and conditions")
bc_checkbox(
"updates",
"Email me updates",
checked = TRUE,
description = "Unsubscribe at any time."
)
Unsubscribe at any time.