A shadcn-styled multi-line <textarea>. Bound by Shiny's native binding;
shiny::updateTextAreaInput() works. autosize = TRUE grows the control to
fit its content (behavior handled by the bundled JS).
Usage
shad_textarea(
inputId,
label = NULL,
value = "",
placeholder = NULL,
rows = 3,
autosize = FALSE,
invalid = FALSE,
disabled = FALSE,
description = NULL,
width = NULL,
class = NULL,
...
)Arguments
- inputId
Input id.
- label
Optional label (wraps in
shad_form_field()).- value
Initial value.
- placeholder
Placeholder text.
- rows
Initial visible rows.
- autosize
If
TRUE, the textarea grows with its content.- invalid
If
TRUE, setsaria-invalid="true"(destructive border).- disabled
If
TRUE, disables the input.- description
Optional help text (wraps in
shad_form_field()).- width
CSS width.
- class
Extra CSS classes.
- ...
Extra attributes.
See also
Other shadshiny tier-2 components:
shad_calendar(),
shad_checkbox(),
shad_combobox(),
shad_date_picker(),
shad_date_presets(),
shad_form_field(),
shad_input(),
shad_input_group(),
shad_input_otp(),
shad_native_select(),
shad_radio_group(),
shad_select(),
shad_slider(),
shad_switch(),
shad_toggle(),
shad_toggle_group()
Examples
shad_textarea("bio", label = "Bio", placeholder = "Tell us about yourself")
#> <div class="shad-form-field" data-shad="form-field">
#> <label class="shad-label">Bio</label>
#> <textarea id="bio" class="shad-textarea" placeholder="Tell us about yourself" rows="3"></textarea>
#> <p class="shad-form-field__error" hidden></p>
#> </div>
shad_textarea("msg", autosize = TRUE)
#> <textarea id="msg" class="shad-textarea" rows="3" data-shad="textarea" data-autosize></textarea>