forked from dreamRs/shinyWidgets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prettyRadioButtons.Rd
128 lines (101 loc) · 4.3 KB
/
prettyRadioButtons.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/input-pretty.R
\name{prettyRadioButtons}
\alias{prettyRadioButtons}
\title{Pretty radio Buttons Input Control}
\usage{
prettyRadioButtons(inputId, label, choices = NULL, selected = NULL,
status = "primary", shape = c("round", "square", "curve"),
outline = FALSE, fill = FALSE, thick = FALSE, animation = NULL,
icon = NULL, plain = FALSE, bigger = FALSE, inline = FALSE,
width = NULL, choiceNames = NULL, choiceValues = NULL)
}
\arguments{
\item{inputId}{The \code{input} slot that will be used to access the value.}
\item{label}{Display label for the control.}
\item{choices}{List of values to show radio buttons for. If elements of the list
are named then that name rather than the value is displayed to the user. If
this argument is provided, then \code{choiceNames} and \code{choiceValues} must not be provided,
and vice-versa. The values should be strings; other types (such as logicals and
numbers) will be coerced to strings.}
\item{selected}{The values that should be initially selected,
(if not specified then defaults to the first value).}
\item{status}{Add a class to the radio,
you can use Bootstrap status like 'info', 'primary', 'danger', 'warning' or 'success'.}
\item{shape}{Shape of the radio between \code{square}, \code{curve} and \code{round}.}
\item{outline}{Color also the border of the radio (\code{TRUE} or \code{FALSE}).}
\item{fill}{Fill the radio with color (\code{TRUE} or \code{FALSE}).}
\item{thick}{Make the content inside radio smaller (\code{TRUE} or \code{FALSE}).}
\item{animation}{Add an animation when radio is checked, a value between
\code{smooth}, \code{jelly}, \code{tada}, \code{rotate}, \code{pulse}.}
\item{icon}{Optional, display an icon on the radio, must be an icon created with \code{icon}.}
\item{plain}{Remove the border when radio is checked (\code{TRUE} or \code{FALSE}).}
\item{bigger}{Scale the radio a bit bigger (\code{TRUE} or \code{FALSE}).}
\item{inline}{If \code{TRUE}, render the choices inline (i.e. horizontally).}
\item{width}{The width of the input, e.g. \code{400px}, or \code{100\%}.}
\item{choiceNames}{List of names to display to the user.}
\item{choiceValues}{List of values corresponding to \code{choiceNames}}
}
\value{
A character vector or \code{NULL} server-side.
}
\description{
Create a set of radio buttons used to select an item from a list.
}
\examples{
\dontrun{
if (interactive()) {
library(shiny)
library(shinyWidgets)
ui <- fluidPage(
tags$h1("Pretty radio buttons"),
br(),
fluidRow(
column(
width = 4,
prettyRadioButtons(inputId = "radio1",
label = "Click me!",
choices = c("Click me !", "Me !", "Or me !")),
verbatimTextOutput(outputId = "res1"),
br(),
prettyRadioButtons(inputId = "radio4", label = "Click me!",
choices = c("Click me !", "Me !", "Or me !"),
outline = TRUE,
plain = TRUE, icon = icon("thumbs-up")),
verbatimTextOutput(outputId = "res4")
),
column(
width = 4,
prettyRadioButtons(inputId = "radio2",
label = "Click me!", thick = TRUE,
choices = c("Click me !", "Me !", "Or me !"),
animation = "pulse", status = "info"),
verbatimTextOutput(outputId = "res2"),
br(),
prettyRadioButtons(inputId = "radio5",
label = "Click me!", icon = icon("check"),
choices = c("Click me !", "Me !", "Or me !"),
animation = "tada", status = "default"),
verbatimTextOutput(outputId = "res5")
),
column(
width = 4,
prettyRadioButtons(inputId = "radio3", label = "Click me!",
choices = c("Click me !", "Me !", "Or me !"),
shape = "round", status = "danger",
fill = TRUE, inline = TRUE),
verbatimTextOutput(outputId = "res3")
)
)
)
server <- function(input, output, session) {
output$res1 <- renderPrint(input$radio1)
output$res2 <- renderPrint(input$radio2)
output$res3 <- renderPrint(input$radio3)
output$res4 <- renderPrint(input$radio4)
output$res5 <- renderPrint(input$radio5)
}
shinyApp(ui, server)
}
}
}