mk_multi_picker: A dropdown box where multiple choices can be selected.

View source: R/mk-multi-picker.R

mk_multi_pickerR Documentation

A dropdown box where multiple choices can be selected.

Description

Create a plain dropdown box where multiple choices can be selected. When 1 choice is selected, it displays the name of the selected item. When 2 or more choices are selected, it displays the count. It also comes with two buttons that allows people to select all items and unselect all items. In addition, if an item is checked, a check mark will appear next to the item.

Usage

mk_multi_picker(id, label = NULL, choices, selected = NULL)

Arguments

id

String. The input slot that will be used to access the value.

label

String. Display label/title for the checkboxes group, or NULL (default) for no label.

choices

Character vector. List of values to show checkboxes for. If elements of the list are named then names rather than values are displayed to the user. The values should be strings; other types (such as logicals and numbers) will be coerced to strings.

selected

The values that should be initially selected, if any. Default is NULL for no initial selection.

Value

A list of HTML elements that can be added to a UI definition.

See Also

for an example of how to use this function.

Examples

inst/examples/ex-multi-picker.R

cabaceo/shinymod documentation built on Sept. 8, 2023, 12:23 p.m.