| selectInput {tabler} | R Documentation |
Select Input
Description
A dropdown that lets the user pick one item from a list.
A searchable multi-select dropdown: type to filter the choices, click (or press Enter on) one to add it as a removable tag, click a tag's "x" (or press Backspace in the empty search box) to remove it. The server receives the current selection as a character vector.
A horizontal range slider. When value has length 2,
two thumbs are rendered (a "from"/"to" range slider) and the server
receives a length-2 numeric vector, e.g. c(2018, 2022).
Change the choices and/or selected value of a
selectInput already displayed in the browser, without a
full page reload, similar to shiny::updateSelectInput().
Change the value/min/max/step of a sliderInput
already displayed in the browser, similar to
shiny::updateSliderInput().
A single-line text field, optionally with an input mask (e.g. for dates or phone numbers).
A numeric input field with up/down stepper buttons (the
browser's native number spinner is hidden by Tabler's form styling, so
these buttons are rendered explicitly and adjust the value by
step, clamped to min/max).
A date picker built on the browser's native date field: it
shows a calendar picker (click the icon) and also accepts a typed date
in yyyy-mm-dd order. Alternatively, inline = TRUE renders
an always-visible month calendar instead of a text field.
A boolean on/off checkbox.
A clickable button. Its value in input is an integer that
increments by one on each click (starts at 0).
A set of checkboxes for selecting multiple values.
A group of mutually-exclusive radio buttons.
Usage
selectInput(inputId, label, choices, selected = NULL, searchable = TRUE, ...)
selectMultipleInput(inputId, label, choices, selected = NULL, ...)
sliderInput(
inputId,
label,
min,
max,
value,
step = 1,
thumbSize = NULL,
fill = FALSE,
color = NULL,
...
)
updateSelectInput(
session,
inputId,
label = NULL,
choices = NULL,
selected = NULL,
...
)
updateSelectizeInput(
session,
inputId,
label = NULL,
choices = NULL,
selected = NULL,
...
)
updateSliderInput(
session,
inputId,
label = NULL,
value = NULL,
min = NULL,
max = NULL,
step = NULL
)
textInput(inputId, label, value = "", placeholder = NULL, mask = NULL, ...)
numericInput(inputId, label, value, min = NULL, max = NULL, step = 1, ...)
dateInput(
inputId,
label,
value = Sys.Date(),
min = NULL,
max = NULL,
icon = c("none", "left", "right"),
inline = FALSE,
...
)
checkboxInput(
inputId,
label,
value = FALSE,
description = NULL,
inline = FALSE,
...
)
actionButton(inputId, label, class = "btn-primary", icon = NULL, ...)
checkboxGroupInput(inputId, label, choices, selected = NULL)
radioButtons(inputId, label, choices, selected = NULL, inline = FALSE)
Arguments
inputId |
The input identifier. |
label |
Display label. |
choices |
Named or unnamed character vector of choices. |
selected |
Initially-selected value (defaults to first choice). |
searchable |
If TRUE (the default), overlay the dropdown with
a text box that filters choices by substring match anywhere in the
label as the user types (e.g. typing "Korea" narrows the list to
"South Korea", "North Korea", ...), instead of relying on the browser's
native jump-to-prefix <select> behavior. Set to FALSE to
render a plain native dropdown.
|
... |
Additional HTML attributes. |
min |
Minimum selectable date (Date or "yyyy-mm-dd").
|
max |
Maximum selectable date (Date or "yyyy-mm-dd").
|
value |
Initial checked state (FALSE).
|
step |
Step size (default 1).
|
thumbSize |
Optional numeric multiplier of the default handle size
(1rem), e.g. 1 for the normal size, 2 for double
size, 2.5 for 250%. Defaults to NULL (Tabler's built-in
size).
|
fill |
If TRUE, paint the track from the minimum up to the
current value (single slider) or between the two handles (range
slider), instead of leaving the whole track a flat color.
|
color |
Optional accent color for the handle(s) and, when
fill = TRUE, the filled track. Either one of Tabler's named
theme colors ("blue", "azure", "indigo",
"purple", "pink", "red", "orange",
"yellow", "lime", "green", "teal",
"cyan") or any other valid CSS color. Defaults to NULL,
which uses the app's current primary/theme color (see page()).
|
session |
The session object. |
placeholder |
Placeholder text (defaults to mask, if given).
|
mask |
Optional input mask made of "0" digit placeholders
and literal separator characters, e.g. "00/00/0000" for a date
or "(00) 0000-0000" for a phone number. As the user types
digits, the literal characters are inserted automatically.
|
icon |
Optional icon name to prepend. |
inline |
If TRUE, lay the radio buttons out left-to-right
instead of the default top-to-bottom stack.
|
description |
Optional secondary text shown below the label. |
class |
Additional CSS classes (default "btn-primary").
|
Value
An HTML tag.
An HTML tag.
An HTML tag.
Invisibly, NULL.
Invisibly, NULL.
An HTML tag.
An HTML tag.
An HTML tag.
An HTML tag.
An HTML tag.
An HTML tag.
An HTML tag.
Note
The value received in input[[inputId]] on the server is a
"yyyy-mm-dd" character string; wrap it in as.Date() if you
need a Date object.