Skip to contents

Creates a shiny.fluent people picker

Usage

make_people_picker(
  i18n = character(),
  ns = character(),
  id = NA_character_,
  label = character(),
  options = tibble::tibble(),
  value = NULL,
  width = NULL,
  style = character()
)

Arguments

i18n

Translator object from shiny.i18n library

ns

Shiny namespace

id

ID used for the input (character)

label

Label used for the input (character)

options

Options available for the input (data.frame or tibble)

value

Options already selected (character)

width

CSS code for width, could be all CSS forms, as "200px" or "100%" etc (character)

style

CSS style added to the div containing the people picker (character)

Value

HTML / Shiny UI code

Details

Options argument has to be a data.frame or a tibble, with columns = c("key", "imageInitials", "text", "secondaryText").
Key is the ID of the choice, text is the text of the choice, imageInitials are the letters put on a circle, SecondaryText is the text under the principal text.

Examples

if (FALSE) {
options <- tibble::tribble(~key,  ~imageInitials, ~text, ~secondaryText,
  1, "JD", "John Doe", "Clinician",
  2, "DA", "Doug Altman", "Statistician")
make_people_picker(i18n = i18n, ns = ns, id = "my_people_picker", "My people picker", 
  options = options, value = 2, width = "200px")
}