Comments (2)
Thank you !
Your shiny JS tutorial help me a lot, so thanks to you !
I've added an inline
argument to materialSwitch
, so now you can do :
library("shiny")
library("shinyWidgets")
inline <- TRUE
right <- FALSE
ui <- fluidPage(
tags$h2("Inline materialSwitch"),
br(),
materialSwitch(inputId = "msh1", label = "Switch 1", status = "primary", inline = inline, right = right),
materialSwitch(inputId = "msh2", label = "Switch 2", status = "danger", inline = inline, right = right),
materialSwitch(inputId = "msh3", label = "Switch 3", status = "success", inline = inline, right = right),
materialSwitch(inputId = "msh4", label = "Switch 4", status = "warning", inline = inline, right = right),
verbatimTextOutput("value1"),
verbatimTextOutput("value2"),
verbatimTextOutput("value3"),
verbatimTextOutput("value4")
)
server <- function(input, output) {
output$value1 <- renderText(input$msh1)
output$value2 <- renderText(input$msh2)
output$value3 <- renderText(input$msh3)
output$value4 <- renderText(input$msh4)
}
shinyApp(ui = ui, server = server)
There is also an alternative in shiny
with flowLayout
:
library("shiny")
library("shinyWidgets")
ui <- fluidPage(
tags$h2("Inline materialSwitch"),
br(),
flowLayout(
materialSwitch(inputId = "msh1", label = "Switch 1", status = "primary"),
materialSwitch(inputId = "msh2", label = "Switch 2", status = "danger"),
materialSwitch(inputId = "msh3", label = "Switch 3", status = "success"),
materialSwitch(inputId = "msh4", label = "Switch 4", status = "warning")
),
verbatimTextOutput("value1"),
verbatimTextOutput("value2"),
verbatimTextOutput("value3"),
verbatimTextOutput("value4")
)
server <- function(input, output) {
output$value1 <- renderText(input$msh1)
output$value2 <- renderText(input$msh2)
output$value3 <- renderText(input$msh3)
output$value4 <- renderText(input$msh4)
}
shinyApp(ui = ui, server = server)
Best,
Victor
from shinywidgets.
great, thanks a bunch! Also nice to hear our Shiny JS tutorial series was helpful to you :-)
from shinywidgets.
Related Issues (20)
- Reversed logic for named-list input in inputSweetAlert in "select"-mode
- [Feature Request] Provide all drop down style pickers (pickerInput, virtualSelectInput) the option to update on close HOT 4
- materialSwitch won't align to end in flexbox HOT 1
- Internationalization for pickerInput's actions-box HOT 2
- virtualSelectInput hides element name when only one element for one group is present HOT 2
- HTML special characters in `choices` of `pickerInput` when using `choicesOpt`
- Not able to click whole button in quarto HOT 11
- `updateAirDateInput()` does not update selected date if options is used HOT 2
- Spinner remains visible when rendering DT HOT 2
- [docs] deprecated docs in switchInput() HOT 1
- virtualSelectInput(..., multiple = TRUE, showValueAsTags = TRUE, updateOn = "close") -> Removing tags does not have an effect on `input$...` HOT 1
- `sliderTextInput` compatibility problem on Quarto doc in the argument `choices`. HOT 2
- `updateAirDateInput()` does not update value if no options provided HOT 2
- Button width not working in dashboard sidebar
- updateSliderTextInput() doesn't have a default argument for session HOT 1
- radioGroupButton rendered incorrectly by renderUI when used in conjunction with jsTreeR HOT 1
- updateAirDateInput() behaviour inconsistent when server and client timezones differ
- Bug: Special characters in virtualSelectInput HOT 2
- airDatePicker selecting dates works incorrectly in Docker container HOT 2
- Compatibility of WinBox with Dark Theme in bs4Dash HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shinywidgets.