Title: | Shiny Control Panel |
---|---|
Description: | Add shiny inputs with one or more inline buttons that grow and shrink with inputs. Also add tool tips to input buttons and styling and messages for input validation. |
Authors: | Alex Pickering |
Maintainer: | Alex Pickering <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.5 |
Built: | 2025-02-08 03:06:33 UTC |
Source: | https://github.com/alexvpickering/shinypanel |
selectizeInput with buttons and validation utilities
selectizeInputWithButtons( inputId, label, ..., options = NULL, container_id = NULL, help_id = NULL, label_title = NULL, btn_titletips = TRUE, btn_placement = NULL, hide_btns = FALSE )
selectizeInputWithButtons( inputId, label, ..., options = NULL, container_id = NULL, help_id = NULL, label_title = NULL, btn_titletips = TRUE, btn_placement = NULL, hide_btns = FALSE )
inputId |
The |
label |
Display label for the control, or |
... |
One or more |
options |
A list of options. See the documentation of selectize.js
for possible options (character option values inside |
container_id |
id for outer |
help_id |
id for span with class |
label_title |
Optional text to appear in info icon tooltip. Used to provide information to user about input. |
btn_titletips |
if |
btn_placement |
Where the |
hide_btns |
If |
selectizeInput
, html
,
addClass
, toggleSelectizeButtons
.
library(shiny) library(shinypanel) ui <- fluidPage( div(class = 'row', div(class = 'col-sm-12 col-lg-6', div(class = 'well-form', textAreaInputWithButtons( inputId = 'text', label = 'Type something:', actionButton( 'btn3', '', icon('plus', 'fa-fw'), title = 'Click to add something' ) ), selectizeInputWithButtons( inputId = 'selection', label = 'Select something:', label_title = 'Information about input', actionButton( 'btn1', '', icon('tag', 'fa-fw'), title = 'this does something' ), actionButton( 'btn2', '', icon('chevron-right', 'fa-fw'), title = 'this does something else' ), options = list(create = TRUE) ) ) ) ) ) server <- function(input, output, session) { choices <- reactive({ paste('Long Option', 1:5) }) observe({ updateSelectizeInput(session, 'selection', choices = choices()) }) } # shinyApp(ui, server)
library(shiny) library(shinypanel) ui <- fluidPage( div(class = 'row', div(class = 'col-sm-12 col-lg-6', div(class = 'well-form', textAreaInputWithButtons( inputId = 'text', label = 'Type something:', actionButton( 'btn3', '', icon('plus', 'fa-fw'), title = 'Click to add something' ) ), selectizeInputWithButtons( inputId = 'selection', label = 'Select something:', label_title = 'Information about input', actionButton( 'btn1', '', icon('tag', 'fa-fw'), title = 'this does something' ), actionButton( 'btn2', '', icon('chevron-right', 'fa-fw'), title = 'this does something else' ), options = list(create = TRUE) ) ) ) ) ) server <- function(input, output, session) { choices <- reactive({ paste('Long Option', 1:5) }) observe({ updateSelectizeInput(session, 'selection', choices = choices()) }) } # shinyApp(ui, server)
selectizeInput with validation utilities
selectizeInputWithValidation( inputId, label, options = NULL, container_id = NULL, help_id = NULL, label_title = NULL )
selectizeInputWithValidation( inputId, label, options = NULL, container_id = NULL, help_id = NULL, label_title = NULL )
inputId |
The |
label |
Display label for the control, or |
options |
A list of options. See the documentation of selectize.js
for possible options (character option values inside |
container_id |
id for outer |
help_id |
id for span with class |
label_title |
Optional text to appear in info icon tooltip. Used to provide information to user about input. |
selectizeInputWithButtons
, html
,
addClass
, toggleSelectizeButtons
.
textAreaInput with buttons and validation
textAreaInputWithButtons( inputId, label, ..., container_id = NULL, help_id = NULL, label_title = NULL, btn_titletips = TRUE, placeholder = "" )
textAreaInputWithButtons( inputId, label, ..., container_id = NULL, help_id = NULL, label_title = NULL, btn_titletips = TRUE, placeholder = "" )
inputId |
The |
label |
Display label for the control, or |
... |
One or more |
container_id |
id for outer |
help_id |
id for span with class |
label_title |
Optional text to appear in info icon tooltip. Used to provide information to user about input. |
btn_titletips |
if |
placeholder |
A character string giving the user a hint as to what can be entered into the control. Internet Explorer 8 and 9 do not support this option. |
textInput with buttons and validation
textInputWithButtons( inputId, label, ..., value = "", container_id = NULL, help_id = NULL, label_title = NULL, btn_titletips = TRUE, placeholder = "", width = NULL )
textInputWithButtons( inputId, label, ..., value = "", container_id = NULL, help_id = NULL, label_title = NULL, btn_titletips = TRUE, placeholder = "", width = NULL )
inputId |
The |
label |
Display label for the control, or |
... |
One or more |
value |
Initial value. |
container_id |
id for outer |
help_id |
id for span with class |
label_title |
Optional text to appear in info icon tooltip. Used to provide information to user about input. |
btn_titletips |
if |
placeholder |
A character string giving the user a hint as to what can be entered into the control. Internet Explorer 8 and 9 do not support this option. |
width |
The width of the input, e.g. |
textInput with validation
textInputWithValidation( inputId, label, value = "", container_id = NULL, help_id = NULL )
textInputWithValidation( inputId, label, value = "", container_id = NULL, help_id = NULL )
inputId |
The |
label |
Display label for the control, or |
value |
Initial value. |
container_id |
id for outer |
help_id |
id for span with class |
When hiding all buttons, some CSS changes are required to allow return of full-width and rounded corners of selectizeInput.
toggleSelectizeButtons(selectize_id, button_ids, condition)
toggleSelectizeButtons(selectize_id, button_ids, condition)
selectize_id |
id of |
button_ids |
character vector of |
condition |
An optional argument to |