Textarea

Description

A multiline <textarea> carrying the Basecoat textarea class, optionally wrapped with a label in a field.

Usage

bc_textarea(
  ...,
  label = NULL,
  id = NULL,
  placeholder = NULL,
  value = NULL,
  rows = NULL,
  description = NULL,
  name = id,
  required = FALSE,
  disabled = FALSE,
  invalid = FALSE,
  aria_label = NULL
)

Arguments

Argument Description
... Tag attributes for the <textarea>.
label String or tag. The label content.
id String. The input id, required when a label is given.
placeholder String. Placeholder text.
value String. The initial value.
rows String. The rows attribute.
description String or tag. Helper text shown under the input, wired to it with aria-describedby.
name String. The input name, defaulting to id.
required Bool. Whether the input is required.
disabled Bool. Whether the input is disabled.
invalid Bool. Whether to show the invalid state.
aria_label String. Accessible name, for an input with no visible label. A placeholder alone is not one.

Value

A <textarea> tag or, with a label, a <div> tag.

Examples

bc_textarea(placeholder = "Type your message here", aria_label = "Message")

bc_textarea(
  id = "message",
  label = "Message",
  placeholder = "Type your message here",
  description = "Write a short message."
)

Write a short message.