A shadcn-styled <input>. Bound by Shiny's native text-input binding, so
input$<inputId> reflects the value and shiny::updateTextInput() works.
Usage
shad_input(
inputId,
label = NULL,
value = "",
placeholder = NULL,
type = "text",
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.
- type
Input
typeattribute ("text","email","password", ...).- 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_group(),
shad_input_otp(),
shad_native_select(),
shad_radio_group(),
shad_select(),
shad_slider(),
shad_switch(),
shad_textarea(),
shad_toggle(),
shad_toggle_group()
Examples
shad_input("email", type = "email", placeholder = "you@example.com")
#> <input id="email" class="shad-input" type="email" placeholder="you@example.com"/>
shad_input("user", label = "Username", value = "shadcn")
#> <div class="shad-form-field" data-shad="form-field">
#> <label class="shad-label">Username</label>
#> <input id="user" class="shad-input" type="text" value="shadcn"/>
#> <p class="shad-form-field__error" hidden></p>
#> </div>