├── .Rbuildignore ├── .gitattributes ├── .github └── workflows │ ├── main.yml │ └── pkgdown.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── DESCRIPTION ├── LICENSE ├── LICENSE.md ├── NAMESPACE ├── NEWS.md ├── R ├── button.R ├── calendar.R ├── checkbox.R ├── constants.R ├── date_input.R ├── dropdown.R ├── dsl.R ├── grid.R ├── input.R ├── layouts.R ├── menu.R ├── modal.R ├── progress.R ├── rating.R ├── search_field.R ├── semanticPage.R ├── semantic_search.R ├── shiny.R ├── shiny.semantic-package.R ├── slider.R ├── step.R ├── tables.R ├── toast.R ├── uirender.R └── utils.R ├── README.md ├── STYLEGUIDE.md ├── codecov.yml ├── examples ├── app.R ├── calendar │ └── app.R ├── counter_button │ └── app.R ├── customcss │ ├── app.R │ └── styles │ │ ├── semantic.min.css │ │ └── semantic.min.js ├── dropdown_updates │ └── app.R ├── form_inputs │ └── app.R ├── grid │ └── app.R ├── layouts │ ├── flow_layout_app.R │ ├── sidebar_app.R │ ├── simple_sidebar_app.R │ └── vertical_layout.R ├── modal │ ├── app.R │ ├── app_1.R │ ├── app_2.R │ ├── app_3.R │ ├── app_4.R │ ├── app_5.R │ └── app_6.R ├── multiple_checkbox │ └── app.R ├── progress │ └── app.R ├── rating │ └── app.R ├── run.sh ├── search_selection │ ├── api_choices.R │ ├── static_choices.R │ └── static_grouped_choices.R ├── shiny_syntax │ ├── fileInput.R │ ├── numericInput.R │ └── selectInput.R ├── slider_input │ └── app.R ├── steps │ └── app.R ├── tabset │ └── app.R ├── toast │ └── app.R ├── uirender │ └── uirender.Rmd └── www │ ├── .DS_Store │ └── images │ ├── avatar-appsilon.png │ ├── elliot.jpg │ ├── logo-appsilon.png │ ├── new-school.jpg │ └── wireframe.png ├── inst ├── .DS_Store ├── assets │ └── styles │ │ └── style.css └── www │ ├── shiny-custom-input.js │ ├── shiny-semantic-DT.css │ ├── shiny-semantic-button.js │ ├── shiny-semantic-calendar.js │ ├── shiny-semantic-checkbox.js │ ├── shiny-semantic-dropdown.js │ ├── shiny-semantic-fileinput.js │ ├── shiny-semantic-modal.js │ ├── shiny-semantic-numericinput.js │ ├── shiny-semantic-progress.css │ ├── shiny-semantic-progress.js │ ├── shiny-semantic-rating.js │ ├── shiny-semantic-slider.js │ ├── shiny-semantic-step.js │ ├── shiny-semantic-tabset.js │ └── shiny-semantic-toast.js ├── man ├── COLOR_PALETTE.Rd ├── Progress-R6.Rd ├── SIZE_LEVELS.Rd ├── accordion.Rd ├── action_button.Rd ├── attach_rule.Rd ├── button.Rd ├── calendar.Rd ├── card.Rd ├── cards.Rd ├── check_proper_color.Rd ├── check_shiny_param.Rd ├── checkbox.Rd ├── counterbutton.Rd ├── create_modal.Rd ├── data_frame_to_css_grid_template_areas.Rd ├── date_input.Rd ├── define_selection_type.Rd ├── digits2words.Rd ├── display_grid.Rd ├── dot-onLoad.Rd ├── dropdown_input.Rd ├── dropdown_menu.Rd ├── extract_icon_name.Rd ├── field.Rd ├── fields.Rd ├── figures │ ├── after_wq.png │ ├── before_wq.png │ ├── churn.png │ ├── fraud.png │ ├── hexsticker.png │ ├── semantic_components.png │ ├── ss_after.png │ └── ss_before.png ├── file_input.Rd ├── flow_layout.Rd ├── form.Rd ├── generate_random_id.Rd ├── get_css_file.Rd ├── get_dependencies.Rd ├── get_dependencies_path.Rd ├── get_numeric.Rd ├── grapes-colon-colon-colon-grapes.Rd ├── grid.Rd ├── grid_container_css.Rd ├── grid_template.Rd ├── header.Rd ├── horizontal_menu.Rd ├── icon.Rd ├── label.Rd ├── list_container.Rd ├── list_element.Rd ├── list_of_area_tags.Rd ├── menu.Rd ├── menu_divider.Rd ├── menu_header.Rd ├── menu_item.Rd ├── message_box.Rd ├── modal.Rd ├── multiple_checkbox.Rd ├── numeric_input.Rd ├── parse_val.Rd ├── progress.Rd ├── rating_input.Rd ├── register_search.Rd ├── render_menu_link.Rd ├── search_field.Rd ├── search_selection_api.Rd ├── search_selection_choices.Rd ├── segment.Rd ├── selectInput.Rd ├── semanticPage.Rd ├── semantic_DT.Rd ├── semantic_DTOutput.Rd ├── set_tab_id.Rd ├── shiny.semantic-package.Rd ├── shiny_input.Rd ├── shiny_text_input.Rd ├── show_modal.Rd ├── sidebar_layout.Rd ├── single_step.Rd ├── slider.Rd ├── split_args.Rd ├── split_layout.Rd ├── steps.Rd ├── tabset.Rd ├── textAreaInput.Rd ├── text_input.Rd ├── theme_selector.Rd ├── toast.Rd ├── toggle_step_state.Rd ├── uiinput.Rd ├── uirender.Rd ├── updateSelectInput.Rd ├── update_action_button.Rd ├── update_dropdown_input.Rd ├── update_multiple_checkbox.Rd ├── update_numeric_input.Rd ├── update_progress.Rd ├── update_rating.Rd ├── update_slider.Rd ├── update_tabset.Rd ├── vertical_layout.Rd ├── warn_unsupported_args.Rd └── with_progress.Rd ├── pkgdown ├── _pkgdown.yml ├── extra.css └── favicon │ ├── apple-touch-icon-120x120.png │ ├── apple-touch-icon-144x144.png │ ├── apple-touch-icon-180x180.png │ ├── apple-touch-icon-60x60.png │ ├── apple-touch-icon-76x76.png │ ├── apple-touch-icon.png │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ └── favicon.ico ├── shiny.semantic.Rproj ├── tests ├── testthat.R └── testthat │ ├── setup-disable-crashpad.R │ ├── test_button.R │ ├── test_calendar.R │ ├── test_checkbox.R │ ├── test_date_input.R │ ├── test_dropdown.R │ ├── test_dsl.R │ ├── test_grid.R │ ├── test_input.R │ ├── test_layouts.R │ ├── test_menu.R │ ├── test_modal.R │ ├── test_multiple_checkbox.R │ ├── test_progress.R │ ├── test_rating.R │ ├── test_semanticPage.R │ ├── test_slider.R │ ├── test_step.R │ ├── test_style.R │ ├── test_tables.R │ ├── test_uirender.R │ └── test_utils.R └── vignettes ├── basics.Rmd ├── fomantic_js.Rmd ├── intro.Rmd ├── intro_images ├── s0.png ├── s1.png ├── s2.png ├── s3.png ├── s4.png └── s5.png └── semantic_integration.Rmd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^renv$ 2 | ^renv\.lock$ 3 | pkgdown 4 | ^codecov\.yml$ 5 | ^\.travis\.yml$ 6 | ^.*\.Rproj$ 7 | ^\.Rproj\.user$ 8 | ^README\.Rmd$ 9 | ^\.[a-zA-Z]*$ 10 | ^CHANGELOG\.md$ 11 | ^LICENSE\.md$ 12 | ^build_readme\.R$ 13 | ^ci$ 14 | ^circle\.yml$ 15 | ^readme_assets$ 16 | ^docs$ 17 | ^examples$ 18 | ^index.html$ 19 | ^README.md$ 20 | ^STYLEGUIDE.md$ 21 | ^CODE_OF_CONDUCT.md$ 22 | ^doc/* 23 | ^Meta$ 24 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | /inst/www/shared/semantic/semantic.js -merge -diff 2 | /inst/www/shared/semantic/semantic.css -merge -diff 3 | *.min.js -merge -diff 4 | *.min.css -merge -diff 5 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - master 5 | - develop 6 | pull_request: 7 | workflow_dispatch: 8 | 9 | name: R-CMD-check 10 | 11 | jobs: 12 | R-CMD-check: 13 | runs-on: ${{ matrix.config.os }} 14 | 15 | name: ${{ matrix.config.os }} (${{ matrix.config.r }}) 16 | 17 | strategy: 18 | fail-fast: false 19 | matrix: 20 | config: 21 | - {os: macOS-latest, r: 'release'} 22 | - {os: windows-latest, r: 'release'} 23 | - {os: ubuntu-22.04, r: 'devel'} 24 | - {os: ubuntu-22.04, r: 'release'} 25 | - {os: ubuntu-22.04, r: 'oldrel'} 26 | 27 | env: 28 | R_REMOTES_NO_ERRORS_FROM_WARNINGS: true 29 | CRAN: ${{ matrix.config.cran }} 30 | 31 | steps: 32 | - uses: actions/checkout@v3 33 | 34 | - uses: r-lib/actions/setup-r@v2 35 | with: 36 | r-version: ${{ matrix.config.r }} 37 | 38 | - uses: r-lib/actions/setup-pandoc@v2 39 | 40 | - name: Install R package dependencies 41 | uses: r-lib/actions/setup-r-dependencies@v2 42 | with: 43 | extra-packages: local::. # Necessary to avoid object usage linter errors. 44 | 45 | - name: R CMD check 46 | if: always() 47 | uses: r-lib/actions/check-r-package@v2 48 | 49 | - name: Test coverage 50 | if: matrix.config.os == 'ubuntu-22.04' && matrix.config.r == 'release' 51 | run: | 52 | Rscript -e 'covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")' 53 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown.yml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: 6 | - develop 7 | workflow_dispatch: 8 | 9 | name: pkgdown 10 | 11 | jobs: 12 | pkgdown: 13 | runs-on: ubuntu-latest 14 | env: 15 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 16 | steps: 17 | - uses: actions/checkout@v2 18 | 19 | - uses: r-lib/actions/setup-pandoc@v2 20 | 21 | - uses: r-lib/actions/setup-r@v2 22 | with: 23 | use-public-rspm: true 24 | 25 | - uses: r-lib/actions/setup-r-dependencies@v2 26 | with: 27 | extra-packages: any::pkgdown, local::. 28 | needs: website 29 | 30 | - name: Deploy to gh-pages branch 31 | run: | 32 | git config --local user.name "$GITHUB_ACTOR" 33 | git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" 34 | Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | .DS_Store 6 | build 7 | doc 8 | Meta 9 | /docs/ 10 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | 2 | # Contributor Code of Conduct 3 | 4 | As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. 5 | 6 | We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion. 7 | 8 | Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct. 9 | 10 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team. 11 | 12 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers. 13 | 14 | This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at https://www.contributor-covenant.org/version/1/0/0/code-of-conduct.html 15 | 16 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Type: Package 2 | Package: shiny.semantic 3 | Title: Semantic UI Support for Shiny 4 | Version: 0.5.1 5 | Authors@R: c(person("Filip", "Stachura", email = "filip@appsilon.com", role = "aut"), 6 | person("Dominik", "Krzeminski", role = "aut"), 7 | person("Krystian", "Igras", role = "aut"), 8 | person("Adam", "Forys", role = "aut"), 9 | person("Paweł", "Przytuła", email = "pawel@appsilon.com", role = "aut"), 10 | person("Jakub", "Chojna", email = "jakub.chojna@appsilon.com", role = "aut"), 11 | person("Olga", "Mierzwa-Sulima", email = "olga@appsilon.com", role = "aut"), 12 | person("Jakub", "Nowicki", email = "opensource+kuba@appsilon.com", role = c("aut", "cre")), 13 | person("Tymoteusz", "Makowski", email = "tymoteusz.makowski@appsilon.com", role = "aut"), 14 | person("Ashley", "Baldry", role = "ctb"), 15 | person("Pedro", "Manuel Coutinho da Silva", email = "pedro@appsilon.com", role = "ctb"), 16 | person("Kamil", "Żyła", email = "kamil@appsilon.com", role = "ctb"), 17 | person("Rabii", "Bouhestine", role = "ctb"), 18 | person("Federico", "Rivandeira", email = "federico@appsilon.com", role = "ctb"), 19 | person(family = "Appsilon Sp. z o.o.", role = c("cph"))) 20 | Description: Creating a great user interface for your Shiny apps can be a 21 | hassle, especially if you want to work purely in R and don't want to 22 | use, for instance HTML templates. This package adds support for a 23 | powerful UI library Fomantic UI - (before 24 | Semantic). It also supports universal UI input binding that works with 25 | various DOM elements. 26 | License: MIT + file LICENSE 27 | URL: https://appsilon.github.io/shiny.semantic/, https://github.com/Appsilon/shiny.semantic 28 | BugReports: https://github.com/Appsilon/shiny.semantic/issues 29 | Imports: 30 | glue, 31 | grDevices, 32 | htmltools (>= 0.2.6), 33 | htmlwidgets (>= 0.8), 34 | jsonlite, 35 | magrittr, 36 | purrr (>= 0.2.2), 37 | R6, 38 | semantic.assets (>= 1.1.0), 39 | shiny (>= 0.12.1), 40 | stats 41 | Suggests: 42 | covr, 43 | chromote, 44 | dplyr, 45 | DT, 46 | gapminder, 47 | knitr, 48 | leaflet, 49 | lintr, 50 | markdown, 51 | mockery, 52 | plotly, 53 | rcmdcheck, 54 | rmarkdown, 55 | testthat, 56 | shinytest2, 57 | tibble, 58 | withr 59 | VignetteBuilder: 60 | knitr 61 | Encoding: UTF-8 62 | Language: en-US 63 | LazyData: TRUE 64 | RoxygenNote: 7.3.1 65 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2016 2 | COPYRIGHT HOLDER: Appsilon Sp. z o.o. 3 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright © 2016 Appsilon Sp. z o.o. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /R/constants.R: -------------------------------------------------------------------------------- 1 | #' Semantic colors 2 | #' 3 | #' https://github.com/Semantic-Org/Semantic-UI/blob/master/src/themes/default/globals/site.variables 4 | #' 5 | #' @export 6 | COLOR_PALETTE <- c("#A333C8", "#21BA45", "#2185D0", "#DB2828", "#F2711C", "#FBBD08", "#B5CC18", 7 | "#00B5AD", "#6435C9", "#E03997", "#A5673F", "#767676", "#1B1C1D") 8 | names(COLOR_PALETTE) <- c("purple", "green", "blue", "red", "orange", "yellow", "olive", "teal", 9 | "violet", "pink", "brown", "grey", "black") 10 | 11 | #' Allowed sizes 12 | #' @export 13 | SIZE_LEVELS <- c("mini", "tiny", "small", "", "large", "huge", "massive") 14 | -------------------------------------------------------------------------------- /R/shiny.semantic-package.R: -------------------------------------------------------------------------------- 1 | #' Semantic UI wrapper for Shiny 2 | #' 3 | #' 4 | #' @description With this library it’s easy to wrap Shiny with Semantic UI 5 | #' components. Add a few simple lines of code and some CSS classes to give 6 | #' your UI a fresh, modern and highly interactive look. 7 | #' 8 | #' @section Options: 9 | #' There are a number of global options that affect shiny.semantic as well as 10 | #' Shiny behavior.The options can be set globally with `options()` 11 | #' \describe{ 12 | #' \item{shiny.custom.semantic.cdn (defaults to `NULL`)}{This controls from where the css 13 | #' and javascripts will be downloaded.} 14 | #' \item{shiny.custom.semantic (defaults to `NULL`)}{This allows to set custom local path 15 | #' to semantic dependencies.} 16 | #' \item{shiny.minified (defaults to `TRUE`)}{Defines including JavaScript as a minified or 17 | #' un-minified file.} 18 | #' } 19 | #' 20 | #' @keywords internal 21 | "_PACKAGE" 22 | -------------------------------------------------------------------------------- /R/tables.R: -------------------------------------------------------------------------------- 1 | #' Create Semantic DT Table 2 | #' 3 | #' This creates DT table styled with Semantic UI. 4 | #' 5 | #' @param ... datatable parameters, check \code{?DT::datatable} to learn more. 6 | #' @param options datatable options, check \code{?DT::datatable} to learn more. 7 | #' @param style datatable style, check \code{?DT::datatable} to learn more. 8 | #' @param class datatable class, check \code{?DT::datatable} to learn more. 9 | #' 10 | #' @examples 11 | #' if (interactive()){ 12 | #' library(shiny) 13 | #' library(shiny.semantic) 14 | #' 15 | #' ui <- semanticPage( 16 | #' semantic_DTOutput("table") 17 | #' ) 18 | #' server <- function(input, output, session) { 19 | #' output$table <- DT::renderDataTable( 20 | #' semantic_DT(iris) 21 | #' ) 22 | #' } 23 | #' shinyApp(ui, server) 24 | #' } 25 | #' 26 | #' @export 27 | semantic_DT <- function(..., options = list(), style = "semanticui", class = 'ui small compact table') { 28 | DT::datatable( 29 | ..., 30 | options = options, 31 | class = class, 32 | style = style, 33 | rownames = FALSE 34 | ) 35 | } 36 | 37 | #' Semantic DT Output 38 | #' 39 | #' @param ... datatable parameters, check \code{?DT::datatable} to learn more. 40 | #' 41 | #' @return DT Output with semanitc style 42 | #' @export 43 | semantic_DTOutput <- function(...) { 44 | DT::DTOutput(...) 45 | } 46 | -------------------------------------------------------------------------------- /R/uirender.R: -------------------------------------------------------------------------------- 1 | #' Render semanticui htmlwidget 2 | #' 3 | #' htmlwidget that adds semanticui dependencies and 4 | #' renders in viewer or rmarkdown. 5 | #' 6 | #' @import htmlwidgets 7 | #' 8 | #' @param ui UI, which will be wrapped in an htmlwidget. 9 | #' @param width Fixed width for widget (in css units). The default is NULL, 10 | #' which results in intelligent automatic sizing. 11 | #' @param height Fixed height for widget (in css units). The default is NULL, 12 | #' which results in intelligent automatic sizing. 13 | #' @param element_id Use an explicit element ID for the widget 14 | #' (rather than an automatically generated one). 15 | #' @examples 16 | #' library(shiny) 17 | #' library(shiny.semantic) 18 | #' uirender( 19 | #' card( 20 | #' div( 21 | #' class="content", 22 | #' div(class="header", "Elliot Fu"), 23 | #' div(class="meta", "Friend"), 24 | #' div(class="description", "Elliot Fu is a film-maker from New York.") 25 | #' ) 26 | #' ) 27 | #' ) 28 | #' 29 | #' @export 30 | uirender <- function(ui, width = NULL, height = NULL, element_id = NULL) { 31 | semantic.assets::uirender(ui, width = width, height = height, element_id = element_id) 32 | } 33 | -------------------------------------------------------------------------------- /STYLEGUIDE.md: -------------------------------------------------------------------------------- 1 | # Styleguide 2 | 3 | ## Variables and argument names 4 | 5 | Variables follow snake case naming style (unless they overlap with `Shiny` syntax). 6 | Try to give meaningful and self explanatory names. 7 | 8 | ```r 9 | 10 | my_variable <- 33 11 | 12 | function(input, another_argument){} 13 | 14 | ``` 15 | 16 | ## Constants 17 | 18 | Constants are defined with capital letter snake case and kept in the 19 | `constants.R` script (unless they're internal). 20 | 21 | ```r 22 | COLORS <- c("red", "green", "blue") 23 | ``` 24 | 25 | ## Function names 26 | 27 | Function are called with `snake_case`. 28 | 29 | - Functions that define UI should contain name of the element, eg. `box`, `horizontal_menu` 30 | 31 | - Functions that define active elements should contain `input` in their name, eg. `checkbox_input`. 32 | 33 | ## Overriding shiny functions 34 | 35 | When overriding shiny functions we usually follow `shiny` styling. Usually it requires 36 | creating a function with `shiny.semantic` syntax and then implementing a wrapper that 37 | follows `shiny` syntax. 38 | 39 | **!!** Here argument names can actually follow `camelCase` syntax. 40 | 41 | Example: 42 | 43 | ```r 44 | # semantic styling 45 | action_button <- function(input_id, label, icon = NULL, width = NULL, ...) { 46 | ... 47 | } 48 | 49 | # shiny styling 50 | actionButton <- function(inputId, label, icon = NULL, width = NULL, ...) { 51 | ... 52 | } 53 | ``` 54 | 55 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | comment: false 2 | 3 | coverage: 4 | status: 5 | project: 6 | default: 7 | target: auto 8 | threshold: 1% 9 | patch: off 10 | -------------------------------------------------------------------------------- /examples/calendar/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- semanticPage( 5 | title = "Multiple checkbox example", 6 | calendar("date", type = "date", value = "2020-02-20", placeholder = "Select Date", min = "2020-01-01", max = "2020-03-01"), 7 | calendar("month", type = "month", placeholder = "Pick Month"), 8 | textOutput("result"), 9 | actionButton("update", "update calendar") 10 | ) 11 | 12 | server <- function(input, output, session) { 13 | 14 | output$result <- renderText({ 15 | input$month 16 | }) 17 | 18 | observeEvent(input$update, { 19 | update_calendar(session, "date", value = "2021-02-20", min = "2021-01-01", max = "2021-03-01") 20 | }) 21 | } 22 | 23 | shinyApp(ui = ui, server = server) 24 | -------------------------------------------------------------------------------- /examples/counter_button/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <-semanticPage( 5 | counter_button("counter", "How many dogs?", 6 | icon = icon("dog"), 7 | size = "big", color = "green"), 8 | h1("Dog count:"), 9 | h2(shiny::textOutput("dogs")) 10 | ) 11 | 12 | server <- function(input, output) { 13 | output$dogs <- renderText({ 14 | input$counter 15 | }) 16 | } 17 | 18 | shinyApp(ui, server) 19 | -------------------------------------------------------------------------------- /examples/customcss/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | options(semantic.themes = TRUE) 5 | # Uncomment this line to use your custom style 6 | #options(shiny.custom.semantic = "styles/") 7 | 8 | ui <- shinyUI( 9 | semanticPage( 10 | title = "Website", theme = "cosmo", 11 | div( 12 | style = "margin-left: 210px", 13 | p("website content"), 14 | actionButton("button1", "Go!") 15 | ) 16 | ) 17 | ) 18 | 19 | server <- function(input, output) { 20 | 21 | } 22 | 23 | shinyApp(ui, server) 24 | -------------------------------------------------------------------------------- /examples/customcss/styles/semantic.min.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: lightblue; 3 | } 4 | -------------------------------------------------------------------------------- /examples/dropdown_updates/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- semanticPage( 5 | title = "Dropdown example", 6 | dropdown_input("simple_dropdown", LETTERS[1:5], value = "A", type = "search selection multiple"), 7 | p("Selected letter:"), 8 | textOutput("selected_letter"), 9 | actionButton("simple_button", "Update input to D"), 10 | actionButton("simple_button2", "Update input to use all letters") 11 | ) 12 | 13 | 14 | server <- shinyServer(function(input, output, session) { 15 | output$selected_letter <- renderText(paste(input[["simple_dropdown"]], collapse = ", ")) 16 | 17 | observeEvent(input$simple_button, { 18 | update_dropdown_input(session, "simple_dropdown", value = "D") 19 | }) 20 | 21 | observeEvent(input$simple_button2, { 22 | update_dropdown_input(session, "simple_dropdown", choices = LETTERS, value = input$simple_dropdown) 23 | }) 24 | }) 25 | 26 | shinyApp(ui = ui, server = server) 27 | -------------------------------------------------------------------------------- /examples/layouts/flow_layout_app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- semanticPage( 5 | title = "Flow layout example", 6 | flow_layout( 7 | min_cell_width = 300, 8 | textInput("first-name", label = "First Name", width = "100%"), 9 | textInput("middle-name", label = "Middle Name"), 10 | textInput("last-name", label = "Last Name"), 11 | textInput("address-1", label = "Address Line 1"), 12 | textInput("address-2", label = "Address Line 2"), 13 | textInput("city", label = "City"), 14 | textInput("zip", label = "Zip/Postal Code"), 15 | textInput("country", label = "Country"), 16 | textInput("telephone", label = "Telephone") 17 | ) 18 | ) 19 | 20 | shinyApp(ui = ui, server = function(input, output) {}) 21 | -------------------------------------------------------------------------------- /examples/layouts/sidebar_app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | grid_cell_style = " 5 | align-items: center; 6 | border: 1px solid #ccc; 7 | display: flex; 8 | justify-content: center; 9 | " 10 | 11 | ui <- function() { 12 | shinyUI(semanticPage( 13 | title = "Sidebar Layout Test", 14 | sidebar_layout( 15 | sidebar_panel( 16 | width = 1, 17 | h1("Hello shiny.semantic!"), 18 | sliderInput("obs1", "Select value A:", min = 0, max = 800, value = 200), 19 | sliderInput("obs2", "Select value B:", min = 0, max = 1000, value = 400), 20 | sliderInput("obs3", "Select value C:", min = 0, max = 600, value = 500), 21 | sliderInput("obs4", "Select value D:", min = 0, max = 700, value = 300) 22 | ), 23 | main_panel( 24 | width = 2, 25 | h2("Selected values:"), 26 | grid( 27 | grid_template = grid_template(default = list( 28 | areas = rbind( 29 | c("top_left", "top_right"), 30 | c("bottom_left", "bottom_right") 31 | ), 32 | cols_width = c("1fr", "1fr"), 33 | rows_height = c("1fr", "1fr") 34 | )), 35 | container_style = "gap: 10px;", 36 | area_styles = list( 37 | top_left = grid_cell_style, 38 | top_right = grid_cell_style, 39 | bottom_left = grid_cell_style, 40 | bottom_right = grid_cell_style 41 | ), 42 | top_left = h3(textOutput("obs1")), 43 | top_right = h3(textOutput("obs2")), 44 | bottom_left = h3(textOutput("obs3")), 45 | bottom_right = h3(textOutput("obs4")), 46 | ), 47 | p("Have a nice day!") 48 | ), 49 | min_height = "400px", 50 | mirrored = FALSE, 51 | container_style = "background-color: white;", 52 | area_styles = list( 53 | sidebar_panel = "border: 1px solid #888;", 54 | main_panel = "border: 1px solid #ccc;" 55 | ) 56 | ) 57 | )) 58 | } 59 | 60 | server <- shinyServer(function(input, output) { 61 | output$obs1 <- renderText({ glue::glue("Value A: {input$obs1}") }) 62 | output$obs2 <- renderText({ glue::glue("Value B: {input$obs2}") }) 63 | output$obs3 <- renderText({ glue::glue("Value C: {input$obs3}") }) 64 | output$obs4 <- renderText({ glue::glue("Value D: {input$obs4}") }) 65 | }) 66 | 67 | shinyApp(ui = ui(), server = server) 68 | -------------------------------------------------------------------------------- /examples/layouts/simple_sidebar_app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- semanticPage( 5 | titlePanel("Hello Shiny!"), 6 | sidebar_layout( 7 | sidebar_panel( 8 | sliderInput("obs", 9 | "Number of observations:", 10 | min = 0, 11 | max = 1000, 12 | value = 500), 13 | width = 1 14 | ), 15 | main_panel( 16 | plotOutput("distPlot"), 17 | width = 4 18 | ), 19 | mirrored = FALSE 20 | ) 21 | ) 22 | 23 | server <- function(input, output) { 24 | output$distPlot <- renderPlot({ 25 | hist(rnorm(input$obs)) 26 | }) 27 | } 28 | 29 | shinyApp(ui, server) 30 | -------------------------------------------------------------------------------- /examples/layouts/vertical_layout.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- semanticPage( 5 | vertical_layout( 6 | h1("Title"), h4("Subtitle"), p("paragraph"), h3("footer") 7 | ) 8 | ) 9 | shinyApp(ui, server = function(input, output) { }) 10 | 11 | ui <- semanticPage( 12 | vertical_layout( 13 | h1("Title"), h4("Subtitle"), p("paragraph"), h3("footer"), 14 | adjusted_to_page = FALSE 15 | ) 16 | ) 17 | 18 | shinyApp(ui, server = function(input, output) { }) 19 | -------------------------------------------------------------------------------- /examples/modal/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- function() { 5 | shinyUI( 6 | semanticPage( 7 | title = "Modal example - Static UI modal", 8 | div(id = "modal-open-button", class = "ui button", "Open Modal"), 9 | modal( 10 | div("Example content"), 11 | id = "example-modal", 12 | target = "modal-open-button" 13 | ) 14 | ) 15 | ) 16 | } 17 | 18 | server <- shinyServer(function(input, output) { 19 | 20 | }) 21 | 22 | shinyApp(ui = ui(), server = server) 23 | -------------------------------------------------------------------------------- /examples/modal/app_1.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- function() { 5 | shinyUI( 6 | semanticPage( 7 | title = "Modal example - Basic Modal with Server content", 8 | div(id = "modal-render-button", class = "ui button", "Open Modal"), 9 | modal( 10 | uiOutput("modalRenderContent"), 11 | id = "render-example-modal", 12 | header = list(class = "ui icon", icon("archive")), 13 | class = "basic tiny", 14 | target = "modal-render-button", 15 | settings = list(c("transition", "fade"), c("closable", "false")), 16 | modal_tags = icon("ui close") 17 | ) 18 | ) 19 | ) 20 | } 21 | 22 | server <- shinyServer(function(input, output) { 23 | output$modalRenderContent <- renderUI({ 24 | div("Example content from the server") 25 | }) 26 | }) 27 | 28 | shinyApp(ui = ui(), server = server) 29 | -------------------------------------------------------------------------------- /examples/modal/app_2.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- function() { 5 | shinyUI( 6 | semanticPage( 7 | title = "Modal example - Server side actions", 8 | uiOutput("modalAction"), 9 | actionButton("show", "Show by calling show_modal") 10 | ) 11 | ) 12 | } 13 | 14 | server <- shinyServer(function(input, output) { 15 | observeEvent(input$show, { 16 | show_modal('action-example-modal') 17 | }) 18 | observeEvent(input$hide, { 19 | hide_modal('action-example-modal') 20 | }) 21 | 22 | output$modalAction <- renderUI({ 23 | modal( 24 | actionButton("hide", "Hide by calling hide_modal"), 25 | id = "action-example-modal", 26 | header = "Example header", 27 | footer = "", 28 | class = "tiny" 29 | ) 30 | }) 31 | }) 32 | 33 | shinyApp(ui = ui(), server = server) 34 | -------------------------------------------------------------------------------- /examples/modal/app_3.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- function() { 5 | shinyUI( 6 | semanticPage( 7 | title = "Modal example - Bind to target element", 8 | uiOutput("modalBind"), 9 | div(id = "modal-button", class = "ui button", "Open Modal") 10 | ) 11 | ) 12 | } 13 | 14 | server <- shinyServer(function(input, output) { 15 | 16 | output$modalBind <- renderUI({ 17 | modal( 18 | "This is some example content", 19 | id = "bind-example-modal", 20 | header = "Example header", 21 | class = "tiny", 22 | target = "modal-button") 23 | }) 24 | }) 25 | 26 | shinyApp(ui = ui(), server = server) 27 | -------------------------------------------------------------------------------- /examples/modal/app_4.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- function() { 5 | shinyUI( 6 | semanticPage( 7 | actionButton("show", "Show modal dialog") 8 | ) 9 | ) 10 | } 11 | 12 | server = function(input, output) { 13 | observeEvent(input$show, { 14 | create_modal(modal( 15 | id = "simple-modal", 16 | title = "Important message", 17 | "This is an important message!" 18 | )) 19 | }) 20 | } 21 | 22 | shinyApp(ui = ui(), server = server) 23 | -------------------------------------------------------------------------------- /examples/modal/app_5.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- function() { 5 | shinyUI( 6 | semanticPage( 7 | actionButton("show", "Show modal dialog") 8 | ) 9 | ) 10 | } 11 | 12 | server = function(input, output) { 13 | observeEvent(input$show, { 14 | create_modal(modal( 15 | id = "simple-modal", 16 | title = "Important message", 17 | header = list(style = "background: lightcoral"), 18 | content = list(style = "background: lightblue", `data-custom` = "value", "This is an important message!"), 19 | p("This is also part of the content!") 20 | )) 21 | }) 22 | } 23 | 24 | shinyApp(ui = ui(), server = server) 25 | -------------------------------------------------------------------------------- /examples/modal/app_6.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- function() { 5 | shinyUI( 6 | semanticPage( 7 | actionButton("show", "Show modal dialog") 8 | ) 9 | ) 10 | } 11 | 12 | server <- shinyServer(function(input, output, session) { 13 | observeEvent(input$show, { 14 | create_modal( 15 | modal( 16 | id = "simple-modal", 17 | title = "Important message", 18 | header = "Example modal", 19 | content = "This modal will close after 3 sec.", 20 | footer = NULL, 21 | ) 22 | ) 23 | Sys.sleep(3) 24 | hide_modal(id = "simple-modal") 25 | }) 26 | }) 27 | 28 | shinyApp(ui = ui(), server = server) 29 | -------------------------------------------------------------------------------- /examples/multiple_checkbox/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | library(magrittr) 4 | 5 | ui <- function() { 6 | shinyUI( 7 | semanticPage( 8 | title = "Multiple checkbox example", 9 | div( 10 | class = "ui form", 11 | multiple_checkbox( 12 | "chcbx", "Select type:", c("Type one", "Type two"), c("first", "second"), 13 | type = "slider", position = "inline" 14 | ), 15 | actionButton("chcbx_update", "Update Checkboxes"), 16 | textOutput("chcbx_result"), 17 | 18 | tags$br(), 19 | 20 | multiple_radio( 21 | "radio", "Select type:", c("Option one", "Option two"), c("first", "second"), 22 | "first", position = "inline" 23 | ), 24 | actionButton("radio_update", "Update Checkboxes"), 25 | textOutput("radio_result"), 26 | ) 27 | ) 28 | ) 29 | } 30 | 31 | server <- shinyServer(function(input, output, session) { 32 | observeEvent(input$chcbx_update, { 33 | update_multiple_checkbox( 34 | session, 35 | "chcbx", 36 | choices = c("Type Three", "Type Four"), 37 | c("third", "fourth"), 38 | selected = c("third", "fourth")) 39 | }) 40 | 41 | output$chcbx_result <- renderText({ 42 | input$chcbx 43 | }) 44 | 45 | observeEvent(input$radio_update, { 46 | update_multiple_radio( 47 | session, 48 | "radio", 49 | choices = c("Option Three", "Option Four"), 50 | c("third", "fourth"), 51 | selected = "third") 52 | }) 53 | 54 | output$radio_result <- renderText({ 55 | input$radio 56 | }) 57 | }) 58 | 59 | shinyApp(ui = ui(), server = server) 60 | -------------------------------------------------------------------------------- /examples/progress/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- semanticPage( 5 | segment( 6 | class = "basic", 7 | progress("value_ex", value = 20, total = 100, label = "Label showing {value} of {total}"), 8 | tags$br(), 9 | button("button", "Change value to 40"), 10 | button("button4", "Change text to 'Updated Label'"), 11 | textOutput("value_ex"), 12 | tags$br(), tags$br(), 13 | 14 | progress( 15 | "percent_ex", percent = 35, progress_lab = TRUE, label = "{percent}% complete", label_complete = "All done!" 16 | ), 17 | tags$br(), 18 | button("button2", "Increase by 5%"), 19 | button("button3", "Decrease by 5%"), 20 | textOutput("percent_ex") 21 | ) 22 | ) 23 | 24 | 25 | server <- shinyServer(function(input, output, session) { 26 | output$value_ex <- renderText(input$value_ex) 27 | output$percent_ex <- renderText(input$percent_ex) 28 | 29 | observeEvent(input$button, update_progress(session, "value_ex", type = "value", value = 40)) 30 | observeEvent(input$button4, update_progress(session, "value_ex", type = "label", value = "Updated Label")) 31 | observeEvent(input$button2, update_progress(session, "percent_ex", value = 5)) 32 | observeEvent(input$button3, update_progress(session, "percent_ex", type = "decrement", value = 5)) 33 | }) 34 | 35 | shinyApp(ui = ui, server = server) 36 | -------------------------------------------------------------------------------- /examples/rating/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- function() { 5 | shinyUI( 6 | semanticPage( 7 | title = "Rating example", 8 | rating_input("rating", "How much do you like this example?", 9 | icon = "heart", max = 8, color = "green", size = "huge"), 10 | p("Your rate:"), 11 | textOutput("your_rate"), 12 | button("update", "Update rate") 13 | ) 14 | ) 15 | } 16 | 17 | server <- shinyServer(function(input, output, session) { 18 | output$your_rate <- renderText(input[["rating"]]) 19 | 20 | observeEvent(input$update, { 21 | update_rating_input(session, "rating", "New label", 2) 22 | }, ignoreInit = TRUE) 23 | }) 24 | 25 | shinyApp(ui = ui(), server = server) 26 | -------------------------------------------------------------------------------- /examples/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | R -e 'shiny::runApp(".")' 3 | 4 | -------------------------------------------------------------------------------- /examples/search_selection/api_choices.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | library(gapminder) 4 | library(dplyr) 5 | 6 | ui <- function() { 7 | shinyUI( 8 | semanticPage( 9 | title = "Dropdown example", 10 | uiOutput("search_countries"), 11 | p("Selected countries:"), 12 | textOutput("selected_countries") 13 | ) 14 | ) 15 | } 16 | 17 | server <- shinyServer(function(input, output, session) { 18 | 19 | search_api <- function(gapminder, q){ 20 | has_matching <- function(field) { 21 | startsWith(field, q) 22 | } 23 | gapminder %>% 24 | mutate(country = as.character(country)) %>% 25 | select(country) %>% 26 | unique %>% 27 | filter(has_matching(country)) %>% 28 | head(5) %>% 29 | transmute(name = country, 30 | value = country) 31 | } 32 | 33 | search_api_url <- shiny.semantic::register_search(session, gapminder, search_api) 34 | output$search_countries <- shiny::renderUI(search_selection_api("search_result", search_api_url, multiple = TRUE)) 35 | output$selected_countries <- renderText(input[["search_result"]]) 36 | }) 37 | 38 | shinyApp(ui = ui(), server = server) 39 | -------------------------------------------------------------------------------- /examples/search_selection/static_choices.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- function() { 5 | shinyUI( 6 | semanticPage( 7 | title = "Dropdown example", 8 | uiOutput("search_letters"), 9 | p("Selected letter:"), 10 | textOutput("selected_letters") 11 | ) 12 | ) 13 | } 14 | 15 | server <- shinyServer(function(input, output, session) { 16 | choices <- LETTERS 17 | output$search_letters <- shiny::renderUI( 18 | search_selection_choices("search_result", choices, value = "A", multiple = TRUE) 19 | ) 20 | output$selected_letters <- renderText(input[["search_result"]]) 21 | }) 22 | 23 | shinyApp(ui = ui(), server = server) 24 | 25 | -------------------------------------------------------------------------------- /examples/search_selection/static_grouped_choices.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | library(gapminder) 4 | 5 | countries <- unique(gapminder[, c("country", "continent")]) 6 | 7 | ui <- function() { 8 | shinyUI( 9 | semanticPage( 10 | title = "Dropdown example", 11 | uiOutput("search_letters"), 12 | p("Selected country:"), 13 | textOutput("selected_country") 14 | ) 15 | ) 16 | } 17 | 18 | server <- shinyServer(function(input, output, session) { 19 | choices <- countries$country 20 | groups <- countries$continent 21 | output$search_letters <- shiny::renderUI( 22 | search_selection_choices("search_result", choices, value = "Italy", multiple = TRUE, groups = groups)) 23 | output$selected_country <- renderText(input[["search_result"]]) 24 | }) 25 | 26 | shinyApp(ui = ui(), server = server) 27 | 28 | -------------------------------------------------------------------------------- /examples/shiny_syntax/fileInput.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- shinyUI( 5 | semanticPage( 6 | fileInput("file_ex", "File Input", width = "400px", type = "small"), 7 | h3("File type uploaded"), 8 | textOutput("file_ex") 9 | ) 10 | ) 11 | 12 | server <- shinyServer(function(input, output, session) { 13 | output$file_ex <- renderText({ 14 | if (is.null(input$file_ex)) return("No file uploaded") 15 | tools::file_ext(input$file_ex$datapath) 16 | }) 17 | }) 18 | 19 | shiny::shinyApp(ui, server) 20 | -------------------------------------------------------------------------------- /examples/shiny_syntax/numericInput.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- shinyUI( 5 | semanticPage( 6 | numericInput("text_ex", "Label", min = 1, max = 20, value = 1.5, step = 0.1, width = "300px", 7 | icon = icon("cat"), type = "small"),# numericinput specific params 8 | textOutput("text_ex"), 9 | actionButton("change", "Change Label") 10 | ) 11 | ) 12 | 13 | server <- shinyServer(function(input, output, session) { 14 | output$text_ex <- renderText({ 15 | input$text_ex 16 | }) 17 | observeEvent(input$change, { 18 | updateNumericInput(session, "text_ex", label = "New label", value = 10, step = 1) 19 | }) 20 | }) 21 | 22 | shiny::shinyApp(ui, server) 23 | -------------------------------------------------------------------------------- /examples/shiny_syntax/selectInput.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | shinyApp( 5 | ui = semanticPage( 6 | selectInput("variable", "Variable:", 7 | c("Cylinders" = "cyl", 8 | "Transmission" = "am", 9 | "Gears" = "gear"), selectize = TRUE, multiple = TRUE, width = "300px"), 10 | actionButton("trig", "Cli", icon = icon("dog")), 11 | actionButton("justbutton", "Justbutton"), 12 | tableOutput("data") 13 | ), 14 | server = function(input, output, session) { 15 | output$data <- renderTable({ 16 | mtcars[, c("mpg", input$variable), drop = FALSE] 17 | }, rownames = TRUE) 18 | 19 | observeEvent(input$trig, { 20 | updateSelectInput(session, "variable", "New variable", 21 | choices = c("Cyl" = "cyl", "Am" = "am", "Gear" = "gear"), 22 | selected = "am") 23 | }, ignoreInit = TRUE, ignoreNULL = TRUE) 24 | observeEvent(input$justbutton, { 25 | updateActionButton(session, "trig", "New label", icon = icon("cat")) 26 | }, ignoreInit = TRUE, ignoreNULL = TRUE) 27 | } 28 | ) 29 | 30 | -------------------------------------------------------------------------------- /examples/slider_input/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- semanticPage( 5 | segment( 6 | class = "basic", 7 | range_input("range_ex", 5, 10, 0, 20, 1, class = "labeled ticked"), 8 | tags$br(), 9 | textOutput("range_ex"), 10 | tags$br(), tags$br(), 11 | slider_input("slider_ex", 5, 0, 20, 1), 12 | tags$br(), 13 | textOutput("slider_ex"), 14 | tags$br(), tags$br(), 15 | slider_input("custom_slider", "D", custom_ticks = LETTERS), 16 | tags$br(), 17 | textOutput("custom_slider"), 18 | tags$br(), tags$br(), 19 | 20 | p("Update range to 10-17"), 21 | button("button", "Update") 22 | ) 23 | ) 24 | 25 | 26 | server <- shinyServer(function(input, output, session) { 27 | output$range_ex <- renderText(paste(input$range_ex, collapse = ", ")) 28 | output$slider_ex <- renderText(input$slider_ex[1]) 29 | output$custom_slider <- renderText(input$custom_slider) 30 | observeEvent(input$button, update_range_input(session, "range_ex", 10, 17)) 31 | }) 32 | 33 | shinyApp(ui = ui, server = server) 34 | -------------------------------------------------------------------------------- /examples/steps/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- semanticPage( 5 | title = "Steps Example", 6 | shiny::tagList( 7 | h2("Steps example"), 8 | steps( 9 | id = "steps", 10 | steps_list = list( 11 | single_step( 12 | id = "step_1", 13 | title = "Step 1", 14 | description = "It's night?", 15 | icon_class = "moon" 16 | ), 17 | single_step( 18 | id = "step_2", 19 | title = "Step 2", 20 | description = "Order some food", 21 | icon_class = "bug" 22 | ), 23 | single_step( 24 | id = "step_3", 25 | title = "Step 3", 26 | description = "Feed the Kiwi", 27 | icon_class = "kiwi bird" 28 | ) 29 | ) 30 | ), 31 | h3("Actions"), 32 | action_button("step_1_complete", "Make it night"), 33 | action_button("step_2_complete", "Call the insects"), 34 | action_button("step_3_complete", "Feed the Kiwi"), 35 | action_button("hungry_kiwi", "Kiwi is hungry again"), 36 | ) 37 | ) 38 | 39 | server <- function(input, output, session) { 40 | observeEvent(input$step_1_complete, { 41 | toggle_step_state("step_1") 42 | }) 43 | observeEvent(input$step_2_complete, { 44 | toggle_step_state("step_2") 45 | }) 46 | observeEvent(input$step_3_complete, { 47 | toggle_step_state("step_3") 48 | }) 49 | observeEvent(input$hungry_kiwi, { 50 | toggle_step_state("step_1", FALSE) 51 | toggle_step_state("step_2", FALSE) 52 | toggle_step_state("step_3", FALSE) 53 | }) 54 | } 55 | 56 | shinyApp(ui = ui, server = server) 57 | -------------------------------------------------------------------------------- /examples/tabset/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- semanticPage( 5 | action_button("changetab", "Select First Tab!"), 6 | br(),br(), 7 | uiOutput("activetab"), 8 | br(),br(), 9 | selectInput( 10 | inputId = "plot1xaxis", 11 | label = "change x axis variable in third tab:", 12 | choices = names(mtcars), 13 | selected = "mpg", 14 | width = 200 15 | ), 16 | br(),br(), 17 | tabset( 18 | tabs = list( 19 | list(menu = "First Tab", content = "Text works well", id = "first_tab"), 20 | list(menu = "Second Tab", content = plotOutput("plot1"), id = "second_tab"), 21 | list(menu = "Third Tab", content = plotOutput("plot2")) 22 | ), 23 | active = "second_tab", 24 | id = "exampletabset" 25 | ) 26 | ) 27 | server <- function(input, output, session) { 28 | 29 | observeEvent(input$changetab,{ 30 | update_tabset(session, "exampletabset", "first_tab") 31 | }) 32 | 33 | output$plot1 <- renderPlot( 34 | plot(c(1, 2), c(1, 5), type = 'b', main = "Plot 1", 35 | xlab = "x axis", ylab = "y axis") 36 | ) 37 | 38 | output$plot2 <- renderPlot( 39 | plot(mtcars[[input$plot1xaxis]], mtcars$cyl, col = 'red', 40 | xlab = input$plot1xaxis, ylab = "cyl") 41 | ) 42 | 43 | output$activetab <- renderUI( 44 | p(strong("Active Tab ID: "), input$exampletabset) 45 | ) 46 | } 47 | 48 | shiny::shinyApp(ui, server) 49 | -------------------------------------------------------------------------------- /examples/toast/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shiny.semantic) 3 | 4 | ui <- semanticPage( 5 | segment( 6 | class = "basic", 7 | button("button", "Show a basic toast"), 8 | button("button2", "Show a warning toast in bottom right"), 9 | button("button3", "Show a toast with a button"), 10 | button("button4", "Show a toast that doesn't close") 11 | ) 12 | ) 13 | 14 | 15 | server <- shinyServer(function(input, output, session) { 16 | observeEvent(input$button, toast("Simple toast", session = session)) 17 | 18 | observeEvent( 19 | input$button2, 20 | toast( 21 | "Simple toast", class = "warning", session = session, 22 | toast_tags = list(position = "bottom right", showIcon = "exclamation triangle") 23 | ) 24 | ) 25 | 26 | observeEvent( 27 | input$button3, 28 | toast( 29 | "Simple toast", class = "olive", session = session, 30 | action = list( 31 | list( 32 | text = "Yes", icon = "check", class = "green", 33 | click = "(function() { $('body').toast({message:'You clicked \"yes\", toast closes by default'}); })" 34 | ), 35 | list( 36 | text = "No", icon = "times", class = "red", 37 | click = "(function() { $('body').toast({message:'You clicked \"no\", toast closes by default'}); })" 38 | ) 39 | ) 40 | ) 41 | ) 42 | 43 | observeEvent( 44 | input$button4, 45 | toast("This toast won't close unless you click me!", duration = 0, session = session) 46 | ) 47 | }) 48 | 49 | shinyApp(ui = ui, server = server) 50 | -------------------------------------------------------------------------------- /examples/uirender/uirender.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "`uirender` example" 3 | output: html_document 4 | --- 5 | 6 | ```{r setup, include=FALSE} 7 | knitr::opts_chunk$set(echo = TRUE) 8 | 9 | library(shiny) 10 | library(shiny.semantic) 11 | ``` 12 | 13 | ```{r} 14 | uirender( 15 | card( 16 | div( 17 | class = "content", 18 | div(class = "header", "Elliot Fu"), 19 | div(class = "meta", "Friend"), 20 | div(class = "description", "Elliot Fu is a film-maker from New York.") 21 | ) 22 | ) 23 | ) 24 | ``` 25 | -------------------------------------------------------------------------------- /examples/www/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/examples/www/.DS_Store -------------------------------------------------------------------------------- /examples/www/images/avatar-appsilon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/examples/www/images/avatar-appsilon.png -------------------------------------------------------------------------------- /examples/www/images/elliot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/examples/www/images/elliot.jpg -------------------------------------------------------------------------------- /examples/www/images/logo-appsilon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/examples/www/images/logo-appsilon.png -------------------------------------------------------------------------------- /examples/www/images/new-school.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/examples/www/images/new-school.jpg -------------------------------------------------------------------------------- /examples/www/images/wireframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/examples/www/images/wireframe.png -------------------------------------------------------------------------------- /inst/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/inst/.DS_Store -------------------------------------------------------------------------------- /inst/assets/styles/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: oldlace; 3 | font-family: "Lato", sans-serif; 4 | } 5 | h1 { 6 | text-align: center; 7 | font-size: 80px; 8 | font-weight: 300; 9 | padding-top: 1em; 10 | margin: 0; 11 | } 12 | .footer h1 { 13 | font-size: 50px; 14 | } 15 | .footer a { 16 | color: white; 17 | text-decoration: underline; 18 | } 19 | .firebrick a { 20 | color: white; 21 | text-decoration: underline; 22 | } 23 | .section.footer img { 24 | width: 150px !important; 25 | margin: 1em; 26 | margin-bottom: 1em; 27 | } 28 | .subheader { 29 | text-align: center; 30 | } 31 | h2, .subheader { 32 | font-size: 22px; 33 | font-style: italic; 34 | font-weight: 300; 35 | margin: 0; 36 | } 37 | 38 | .main-container { 39 | max-width: 100%; 40 | padding: 0; 41 | } 42 | .custom { 43 | background-color: rgb(52, 52, 52); 44 | } 45 | .section.level2 h2, 46 | .section.level2 li, 47 | .section.level2 p { 48 | margin-top: 1em; 49 | margin-bottom: 1em; 50 | } 51 | .section.level2 { 52 | text-align: left; 53 | padding: 1em 25%; 54 | } 55 | .section.level2 > p, 56 | .section.level2 > h2, 57 | .section.level2 > div { 58 | text-align: left; 59 | margin: 1em 0; 60 | max-width: 940px; 61 | } 62 | @media (max-width: 1440px) { 63 | h1 { 64 | font-size: 50px; 65 | } 66 | .section.level2 { 67 | padding: 1em 12%; 68 | } 69 | } 70 | 71 | .section.level1.footer > p { 72 | text-align: center; 73 | } 74 | .darkslide { 75 | background-color: #343434; 76 | color: darkorange; 77 | } 78 | .footer { 79 | background-color: #343434; 80 | color: white; 81 | padding-bottom: 2em; 82 | text-align: center; 83 | } 84 | .darkslide a { 85 | color: white; 86 | } 87 | .firebrick { 88 | background-color: firebrick; 89 | color: white; 90 | } 91 | .darkorange { 92 | background-color: darkorange; 93 | color: #343434; 94 | } 95 | .logo img { 96 | width: 100px !important; 97 | } 98 | 99 | .section .demo { 100 | color: rgba(0,0,0,.87);; 101 | } 102 | -------------------------------------------------------------------------------- /inst/www/shiny-custom-input.js: -------------------------------------------------------------------------------- 1 | var customShinyInputBinding = new Shiny.InputBinding(); 2 | 3 | $.extend(customShinyInputBinding, { 4 | 5 | // This initialize input element. It extracts data-value attribute and use that as value. 6 | initialize: function(el) { 7 | var val = $(el).attr('data-value'); 8 | $(el).val(val); 9 | }, 10 | 11 | // This returns a jQuery object with the DOM element. 12 | find: function(scope) { 13 | return $(scope).find('.shiny-custom-input'); 14 | }, 15 | 16 | // Returns the ID of the DOM element. 17 | getId: function(el) { 18 | return el.id; 19 | }, 20 | 21 | // Given the DOM element for the input, return the value as JSON. 22 | getValue: function(el) { 23 | var value = $(el).val(); 24 | var value_type = $(el).attr('data-value-type'); 25 | switch (value_type) { 26 | case 'JSON': 27 | return JSON.stringify(value); 28 | case 'text': 29 | return value; 30 | default: 31 | throw new Error("Unrecognized value type of custom shiny input: " + value_type); 32 | } 33 | }, 34 | 35 | // Given the DOM element for the input, set the value. 36 | setValue: function(el, value) { 37 | el.value = value; 38 | }, 39 | 40 | // Set up the event listeners so that interactions with the 41 | // input will result in data being sent to server. 42 | // callback is a function that queues data to be sent to 43 | // the server. 44 | subscribe: function(el, callback) { 45 | $(el).on('keyup change', function () { callback(true); }); 46 | }, 47 | 48 | // TODO: Remove the event listeners. 49 | unsubscribe: function(el) { 50 | }, 51 | 52 | // This returns a full description of the input's state. 53 | getState: function(el) { 54 | return { 55 | value: el.value 56 | }; 57 | }, 58 | 59 | // The input rate limiting policy. 60 | getRatePolicy: function() { 61 | return { 62 | // Can be 'debounce' or 'throttle': 63 | policy: 'debounce', 64 | delay: 500 65 | }; 66 | }, 67 | 68 | receiveMessage: function(el, data) { 69 | if (data.hasOwnProperty('value')) 70 | this.setValue(el, data.value); 71 | 72 | if (data.hasOwnProperty('label')) { 73 | var input = $(el).closest(".ui"); 74 | if (data.label === "") { 75 | input.dropdown('remove selected') 76 | } else { 77 | input.dropdown('set selected', data.label) 78 | } 79 | } 80 | 81 | $(el).trigger('change'); 82 | } 83 | }); 84 | 85 | Shiny.inputBindings.register(customShinyInputBinding, 'shiny.customShinyInput'); 86 | 87 | -------------------------------------------------------------------------------- /inst/www/shiny-semantic-DT.css: -------------------------------------------------------------------------------- 1 | .form-group input { 2 | font-family: Lato,'Helvetica Neue',Arial,Helvetica,sans-serif; 3 | margin: 0; 4 | outline: 0; 5 | -webkit-appearance: none; 6 | -webkit-tap-highlight-color: rgba(255,255,255,0); 7 | line-height: 1.21428571em; 8 | padding: .67857143em 1em; 9 | font-size: 1em; 10 | background: #fff; 11 | border: 1px solid rgba(34,36,38,.15); 12 | color: rgba(0,0,0,.87); 13 | border-radius: .28571429rem; 14 | -webkit-box-shadow: 0 0 0 0 transparent inset; 15 | box-shadow: 0 0 0 0 transparent inset; 16 | -webkit-transition: color .1s ease,border-color .1s ease; 17 | transition: color .1s ease,border-color .1s ease; 18 | } 19 | table.dataTable tr.selected td, table.dataTable td.selected { 20 | background-color: #95d8f5; 21 | } 22 | -------------------------------------------------------------------------------- /inst/www/shiny-semantic-button.js: -------------------------------------------------------------------------------- 1 | 2 | var semanticButtonBinding = new Shiny.InputBinding(); 3 | $.extend(semanticButtonBinding, { 4 | find: function(scope) { 5 | return $(scope).find(".button"); 6 | }, 7 | getValue: function(el) { 8 | return $(el).data('val') || 0; 9 | }, 10 | setValue: function(el, value) { 11 | $(el).data('val', value); 12 | }, 13 | getType: function(el) { 14 | return 'shiny.action'; 15 | }, 16 | subscribe: function(el, callback) { 17 | $(el).on("click.semanticButtonBinding", function(e) { 18 | var $el = $(this); 19 | var val = $el.data('val') || 0; 20 | $el.data('val', val + 1); 21 | 22 | callback(); 23 | }); 24 | }, 25 | getState: function(el) { 26 | return { value: this.getValue(el) }; 27 | }, 28 | receiveMessage: function(el, data) { 29 | var $el = $(el); 30 | // retrieve current label and icon 31 | var label = $el.text(); 32 | var icon = ''; 33 | 34 | // to check (and store) the previous icon, we look for a $el child 35 | // object that has an i tag, and some (any) class (this prevents 36 | // italicized text - which has an i tag but, usually, no class - 37 | // from being mistakenly selected) 38 | if ($el.find('i[class]').length > 0) { 39 | var icon_html = $el.find('i[class]')[0]; 40 | if (icon_html === $el.children()[0]) { // another check for robustness 41 | icon = $(icon_html).prop('outerHTML'); 42 | } 43 | } 44 | 45 | // update the requested properties 46 | if (data.hasOwnProperty('label')) label = data.label; 47 | if (data.hasOwnProperty('icon')) { 48 | icon = data.icon; 49 | // if the user entered icon=character(0), remove the icon 50 | if (icon.length === 0) icon = ''; 51 | } 52 | 53 | // produce new html 54 | $el.html(icon + ' ' + label); 55 | }, 56 | unsubscribe: function(el) { 57 | $(el).off(".semanticButtonBinding"); 58 | } 59 | }); 60 | Shiny.inputBindings.register(semanticButtonBinding, 'shiny.semanticButton'); 61 | -------------------------------------------------------------------------------- /inst/www/shiny-semantic-modal.js: -------------------------------------------------------------------------------- 1 | $.fn.modal.settings.onShow = function(){Shiny.bindAll()}; 2 | 3 | Shiny.addCustomMessageHandler('showSemanticModal', function(message){ 4 | $('#' + message.id).modal(message.action) 5 | }); 6 | 7 | Shiny.initSemanticModal = function(id) { 8 | $('[id="' + id + '"]:not(:first)').remove(); 9 | } 10 | 11 | Shiny.addCustomMessageHandler('createSemanticModal', function(message){ 12 | let id = $(message.ui_modal) 13 | .modal() 14 | .attr("id") 15 | 16 | Shiny.initSemanticModal(id) 17 | 18 | $('#' + id).modal(message.action) 19 | }); 20 | 21 | Shiny.addCustomMessageHandler('hideAllSemanticModals', function(message){ 22 | $(".ui .modal").modal('hide'); 23 | }); 24 | 25 | -------------------------------------------------------------------------------- /inst/www/shiny-semantic-progress.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/inst/www/shiny-semantic-progress.css -------------------------------------------------------------------------------- /inst/www/shiny-semantic-rating.js: -------------------------------------------------------------------------------- 1 | var semanticRatingBinding = new Shiny.InputBinding(); 2 | $.extend(semanticRatingBinding, { 3 | find: function(scope) { 4 | return $(scope).find(".ui.rating"); 5 | }, 6 | initialize: function(el){ 7 | $("#" + el.id).rating('setting', 'clearable', true); 8 | }, 9 | getValue: function(el) { 10 | return $(el).rating('get rating') || 0; 11 | }, 12 | subscribe: function(el, callback) { 13 | $(el).rating('setting', 'onRate', function() { 14 | callback(); 15 | }); 16 | }, 17 | receiveMessage: function(el, data) { 18 | var $el = $(el); 19 | if (data.hasOwnProperty('label')) { 20 | $('label[for="' + el.id + '"]').html(data.label); 21 | } 22 | if (data.hasOwnProperty('value')) { 23 | $(el).rating('set rating', data.value); 24 | } 25 | }, 26 | unsubscribe: function(el) { 27 | $(el).off(); 28 | } 29 | }); 30 | Shiny.inputBindings.register(semanticRatingBinding, 'shiny.semanticRating'); 31 | -------------------------------------------------------------------------------- /inst/www/shiny-semantic-step.js: -------------------------------------------------------------------------------- 1 | const resetAllSteps = (stepperId) => { 2 | $(`#${stepperId}`).children(".step").addClass("disabled"); 3 | $(`#${stepperId}`).children(".step").removeClass("completed"); 4 | // Activating first step 5 | $(`#${stepperId}`).children(".step").first().addClass("active") 6 | $(`#${stepperId}`).children(".step").first().removeClass("disabled"); 7 | } 8 | 9 | const _toggleStepCompleteState = (stepId, state, automaticSteps) => { 10 | state ? _addCompletedState(stepId) : _removeCompletedState(stepId); 11 | _removeActiveState(stepId); 12 | if (automaticSteps) { 13 | _toggleNextStep(stepId, state); 14 | } 15 | } 16 | 17 | const _toggleNextStep = (stepId, state) => { 18 | let next_step = _getNextStep(stepId); 19 | if (next_step) { 20 | state ? _removeDisabledState(next_step.attr("id")) : _addDisabledState(next_step.attr("id")); 21 | state ? _addActiveState(next_step.attr("id")) : _removeActiveState(next_step.attr("id")); 22 | } 23 | } 24 | 25 | const _removeCompletedState = (stepId) => { 26 | $(`#${stepId}`).removeClass("completed"); 27 | } 28 | 29 | const _addCompletedState = (stepId, autodisable = true) => { 30 | $(`#${stepId}`).addClass("completed"); 31 | autodisable ? _removeDisabledState(stepId) : null; 32 | } 33 | 34 | const _removeDisabledState = (stepId) => { 35 | $(`#${stepId}`).removeClass("disabled"); 36 | } 37 | 38 | const _addDisabledState = (stepId) => { 39 | $(`#${stepId}`).addClass("disabled"); 40 | } 41 | 42 | const _removeActiveState = (stepId) => { 43 | $(`#${stepId}`).removeClass("active") 44 | } 45 | 46 | const _addActiveState = (stepId) => { 47 | $(`#${stepId}`).addClass("active") 48 | } 49 | 50 | const _getNextStep = (stepId) => { 51 | let siblingStep = $(`#${stepId}`).next(".step"); 52 | return siblingStep.length > 0 ? siblingStep : false 53 | } 54 | 55 | 56 | const toggleCompletedState = (message) => { 57 | let stepId = message.step_id ? message.step_id : false; 58 | let state = message.state; 59 | let automaticSteps = message.automatic_steps ? true : false; 60 | if (!stepId) { 61 | return 62 | } 63 | _toggleStepCompleteState(stepId, state, automaticSteps) 64 | } 65 | 66 | Shiny.addCustomMessageHandler("toggle_step_state", toggleCompletedState) -------------------------------------------------------------------------------- /inst/www/shiny-semantic-tabset.js: -------------------------------------------------------------------------------- 1 | var semanticTabset = new Shiny.InputBinding(); 2 | 3 | $.extend(semanticTabset, { 4 | find: function(scope) { 5 | return $(scope).find('.ui.menu.sem'); 6 | }, 7 | initialize: function(el){ 8 | $(el).find('.item').tab(); 9 | }, 10 | getValue: function(el) { 11 | var tabsetVal = $(el).find('.active.item').attr('data-tab'); 12 | return tabsetVal; 13 | }, 14 | subscribe: function(el, callback) { 15 | $(el).on('change', function(event) { 16 | $(this).trigger('shown'); 17 | callback(); 18 | }); 19 | $(el).find('.item').on('click', function(event) { 20 | $(this).trigger('shown'); 21 | callback(); 22 | }); 23 | }, 24 | receiveMessage: function(el, data) { 25 | var tab_id; 26 | if (data.hasOwnProperty('selected')) 27 | tab_id = data.selected; 28 | $(el).find('.item').tab('change tab', tab_id); 29 | $(el).trigger('change'); 30 | }, 31 | unsubscribe: function(el) { 32 | $(el).off(); 33 | } 34 | }); 35 | 36 | Shiny.inputBindings.register(semanticTabset, 'shiny.semanticTabset'); 37 | -------------------------------------------------------------------------------- /inst/www/shiny-semantic-toast.js: -------------------------------------------------------------------------------- 1 | Shiny.initSemanticToast = function(id) { 2 | $('[id="' + id + '"]:not(:first)').remove(); 3 | }; 4 | 5 | Shiny.addCustomMessageHandler('createSemanticToast', function(message) { 6 | Shiny.initSemanticToast(message.id); 7 | 8 | const toast_message = message.message; 9 | // Changes character string into function 10 | if (toast_message.hasOwnProperty('actions')) { 11 | for (i = 0; i < toast_message.actions.length; i++) { 12 | if (toast_message.actions[i].hasOwnProperty('click')) { 13 | toast_message.actions[i].click = eval(toast_message.actions[i].click); 14 | } 15 | } 16 | } 17 | 18 | const sem_toast = $('body').toast(toast_message); 19 | $(sem_toast).attr('id', `${message.id}`); 20 | }); 21 | 22 | Shiny.addCustomMessageHandler('closeSemanticToast', function(message) { 23 | $(`#${message.id}`).toast('close'); 24 | }); 25 | -------------------------------------------------------------------------------- /man/COLOR_PALETTE.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/constants.R 3 | \docType{data} 4 | \name{COLOR_PALETTE} 5 | \alias{COLOR_PALETTE} 6 | \title{Semantic colors} 7 | \format{ 8 | An object of class \code{character} of length 13. 9 | } 10 | \usage{ 11 | COLOR_PALETTE 12 | } 13 | \description{ 14 | https://github.com/Semantic-Org/Semantic-UI/blob/master/src/themes/default/globals/site.variables 15 | } 16 | \keyword{datasets} 17 | -------------------------------------------------------------------------------- /man/SIZE_LEVELS.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/constants.R 3 | \docType{data} 4 | \name{SIZE_LEVELS} 5 | \alias{SIZE_LEVELS} 6 | \title{Allowed sizes} 7 | \format{ 8 | An object of class \code{character} of length 7. 9 | } 10 | \usage{ 11 | SIZE_LEVELS 12 | } 13 | \description{ 14 | Allowed sizes 15 | } 16 | \keyword{datasets} 17 | -------------------------------------------------------------------------------- /man/accordion.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{accordion} 4 | \alias{accordion} 5 | \title{Accordion UI} 6 | \usage{ 7 | accordion( 8 | accordion_list, 9 | fluid = TRUE, 10 | active_title = "", 11 | styled = TRUE, 12 | custom_style = "" 13 | ) 14 | } 15 | \arguments{ 16 | \item{accordion_list}{list with lists with fields: `title` and `content`} 17 | 18 | \item{fluid}{if accordion is fluid then it takes width of parent div} 19 | 20 | \item{active_title}{if active title matches `title` from \code{accordion_list} 21 | then this element is active by default} 22 | 23 | \item{styled}{if switched of then raw style (no boxes) is used} 24 | 25 | \item{custom_style}{character with custom style added to CSS of accordion (advanced use)} 26 | } 27 | \value{ 28 | shiny tag list with accordion UI 29 | } 30 | \description{ 31 | In accordion you may display a list of elements that can be hidden or 32 | shown with one click. 33 | } 34 | \examples{ 35 | if (interactive()) { 36 | library(shiny) 37 | library(shiny.semantic) 38 | accordion_content <- list( 39 | list(title = "AA", content = h2("a a a a")), 40 | list(title = "BB", content = p("b b b b")) 41 | ) 42 | shinyApp( 43 | ui = semanticPage( 44 | accordion(accordion_content, fluid = F, active_title = "AA", 45 | custom_style = "background: #babade;") 46 | ), 47 | server = function(input, output) {} 48 | ) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /man/action_button.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/button.R 3 | \name{action_button} 4 | \alias{action_button} 5 | \alias{actionButton} 6 | \title{Action button} 7 | \usage{ 8 | action_button(input_id, label, icon = NULL, width = NULL, ...) 9 | 10 | actionButton(inputId, label, icon = NULL, width = NULL, ...) 11 | } 12 | \arguments{ 13 | \item{input_id}{The input slot that will be used to access the value.} 14 | 15 | \item{label}{The contents of the button - a text label, but you could also use any other HTML, like an image.} 16 | 17 | \item{icon}{An optional \link{icon} to appear on the button.} 18 | 19 | \item{width}{The width of the input.} 20 | 21 | \item{...}{Named attributes to be applied to the button or remaining parameters passed to button, 22 | like \code{class}.} 23 | 24 | \item{inputId}{the same as \code{input_id}} 25 | } 26 | \description{ 27 | Creates an action button whose value is initially zero, and increments by one each time it is pressed. 28 | } 29 | \examples{ 30 | if (interactive()){ 31 | library(shiny) 32 | library(shiny.semantic) 33 | ui <- shinyUI(semanticPage( 34 | actionButton("action_button", "Press Me!"), 35 | textOutput("button_output") 36 | )) 37 | server <- function(input, output, session) { 38 | output$button_output <- renderText(as.character(input$action_button)) 39 | } 40 | shinyApp(ui, server) 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /man/attach_rule.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modal.R 3 | \name{attach_rule} 4 | \alias{attach_rule} 5 | \title{Internal function that creates the rule for a specific setting or behavior of the modal.} 6 | \usage{ 7 | attach_rule(id, behavior, target, value) 8 | } 9 | \arguments{ 10 | \item{id}{ID of the target modal.} 11 | 12 | \item{behavior}{What behavior is beging set i. e. setting or attach events.} 13 | 14 | \item{target}{First argument of the behavior. Usually a target or a setting name.} 15 | 16 | \item{value}{Second argument of the behavior. usually an action or a setting value.} 17 | } 18 | \description{ 19 | Internal function that creates the rule for a specific setting or behavior of the modal. 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/button.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/button.R 3 | \name{button} 4 | \alias{button} 5 | \title{Create Semantic UI Button} 6 | \usage{ 7 | button(input_id, label, icon = NULL, class = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{input_id}{The \code{input} slot that will be used to access the value.} 11 | 12 | \item{label}{The contents of the button or link} 13 | 14 | \item{icon}{An optional \code{\link{icon}()} to appear on the button.} 15 | 16 | \item{class}{An optional attribute to be added to the button's class. If used 17 | paramters like \code{color}, \code{size} are ignored.} 18 | 19 | \item{...}{Named attributes to be applied to the button} 20 | } 21 | \description{ 22 | Create Semantic UI Button 23 | } 24 | \examples{ 25 | if (interactive()){ 26 | library(shiny) 27 | library(shiny.semantic) 28 | ui <- semanticPage( 29 | shinyUI( 30 | button("simple_button", "Press Me!") 31 | ) 32 | ) 33 | server <- function(input, output, session) { 34 | } 35 | shinyApp(ui, server) 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /man/calendar.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calendar.R 3 | \name{calendar} 4 | \alias{calendar} 5 | \alias{update_calendar} 6 | \title{Create Semantic UI Calendar} 7 | \usage{ 8 | calendar( 9 | input_id, 10 | value = NULL, 11 | placeholder = NULL, 12 | type = "date", 13 | min = NA, 14 | max = NA 15 | ) 16 | 17 | update_calendar(session, input_id, value = NULL, min = NULL, max = NULL) 18 | } 19 | \arguments{ 20 | \item{input_id}{ID of the calendar that will be updated} 21 | 22 | \item{value}{Initial value of the numeric input.} 23 | 24 | \item{placeholder}{Text visible in the input when nothing is inputted.} 25 | 26 | \item{type}{Select from \code{'year'}, \code{'month'}, \code{'date'} and \code{'time'}} 27 | 28 | \item{min}{Minimum allowed value.} 29 | 30 | \item{max}{Maximum allowed value.} 31 | 32 | \item{session}{The \code{session} object passed to function given to 33 | \code{shinyServer}.} 34 | } 35 | \description{ 36 | This creates a default calendar input using Semantic UI. The input is available 37 | under \code{input[[input_id]]}. 38 | 39 | This function updates the date on a calendar 40 | } 41 | \examples{ 42 | # Basic calendar 43 | if (interactive()) { 44 | 45 | library(shiny) 46 | library(shiny.semantic) 47 | 48 | ui <- shinyUI( 49 | semanticPage( 50 | title = "Calendar example", 51 | calendar("date"), 52 | p("Selected date:"), 53 | textOutput("selected_date") 54 | ) 55 | ) 56 | 57 | server <- shinyServer(function(input, output, session) { 58 | output$selected_date <- renderText( 59 | as.character(input$date) 60 | ) 61 | }) 62 | 63 | shinyApp(ui = ui, server = server) 64 | } 65 | 66 | \dontrun{ 67 | # Calendar with max and min 68 | calendar( 69 | name = "date_finish", 70 | placeholder = "Select End Date", 71 | min = "2019-01-01", 72 | max = "2020-01-01" 73 | ) 74 | 75 | # Selecting month 76 | calendar( 77 | name = "month", 78 | type = "month" 79 | ) 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /man/card.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{card} 4 | \alias{card} 5 | \title{Create Semantic UI card tag} 6 | \usage{ 7 | card(..., class = "") 8 | } 9 | \arguments{ 10 | \item{...}{Other arguments to be added as attributes of the 11 | tag (e.g. style, class or childrens etc.)} 12 | 13 | \item{class}{Additional classes to add to html tag.} 14 | } 15 | \description{ 16 | This creates a card tag using Semantic UI styles. 17 | } 18 | \examples{ 19 | ## Only run examples in interactive R sessions 20 | if (interactive()){ 21 | library(shiny) 22 | library(shiny.semantic) 23 | 24 | ui <- shinyUI(semanticPage( 25 | card( 26 | div(class="content", 27 | div(class="header", "Elliot Fu"), 28 | div(class="meta", "Friend"), 29 | div(class="description", "Elliot Fu is a film-maker from New York.") 30 | ) 31 | ) 32 | )) 33 | server <- shinyServer(function(input, output) { 34 | }) 35 | 36 | shinyApp(ui, server) 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /man/cards.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{cards} 4 | \alias{cards} 5 | \title{Create Semantic UI cards tag} 6 | \usage{ 7 | cards(..., class = "") 8 | } 9 | \arguments{ 10 | \item{...}{Other arguments to be added as attributes of the 11 | tag (e.g. style, class or childrens etc.)} 12 | 13 | \item{class}{Additional classes to add to html tag.} 14 | } 15 | \description{ 16 | This creates a cards tag using Semantic UI styles. 17 | } 18 | \examples{ 19 | ## Only run examples in interactive R sessions 20 | if (interactive()){ 21 | library(shiny) 22 | library(shiny.semantic) 23 | 24 | ui <- shinyUI(semanticPage( 25 | cards( 26 | class = "two", 27 | card( 28 | div(class="content", 29 | div(class="header", "Elliot Fu"), 30 | div(class="meta", "Friend"), 31 | div(class="description", "Elliot Fu is a film-maker from New York.") 32 | ) 33 | ), 34 | card( 35 | div(class="content", 36 | div(class="header", "John Bean"), 37 | div(class="meta", "Friend"), 38 | div(class="description", "John Bean is a film-maker from London.") 39 | ) 40 | ) 41 | ) 42 | )) 43 | server <- shinyServer(function(input, output) { 44 | }) 45 | 46 | shinyApp(ui, server) 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /man/check_proper_color.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{check_proper_color} 4 | \alias{check_proper_color} 5 | \title{Check if color is set from Fomantic-UI palette} 6 | \usage{ 7 | check_proper_color(color) 8 | } 9 | \arguments{ 10 | \item{color}{character with color name} 11 | } 12 | \value{ 13 | Error when \code{color} does not belong to palette 14 | } 15 | \description{ 16 | Check if color is set from Fomantic-UI palette 17 | } 18 | \examples{ 19 | check_proper_color("blue") 20 | } 21 | -------------------------------------------------------------------------------- /man/check_shiny_param.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{check_shiny_param} 4 | \alias{check_shiny_param} 5 | \title{Checks whether argument included as shiny exclusive parameter} 6 | \usage{ 7 | check_shiny_param(name, func, ...) 8 | } 9 | \arguments{ 10 | \item{name}{Function argument name} 11 | 12 | \item{func}{Name of the function in the} 13 | 14 | \item{...}{Arguments passed to the shiny.semantic version of the shiny function} 15 | } 16 | \value{ 17 | If the shiny exclusive argument is called in a shiny.semantic, then a message is posted in the UI 18 | } 19 | \description{ 20 | A quick function to check a shiny.semantic wrapper of a shiny function to see whether any 21 | extra arguments are called that aren't required for the shiny.semantic version 22 | } 23 | \keyword{internal} 24 | -------------------------------------------------------------------------------- /man/checkbox.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/checkbox.R 3 | \name{checkbox_input} 4 | \alias{checkbox_input} 5 | \alias{toggle} 6 | \alias{This} 7 | \alias{creates} 8 | \alias{a} 9 | \alias{checkbox} 10 | \alias{using} 11 | \alias{Semantic} 12 | \alias{UI} 13 | \alias{styles.} 14 | \alias{checkboxInput} 15 | \title{Create Semantic UI checkbox} 16 | \usage{ 17 | checkbox_input( 18 | input_id, 19 | label = "", 20 | type = NULL, 21 | is_marked = TRUE, 22 | style = NULL 23 | ) 24 | 25 | checkboxInput(inputId, label = "", value = FALSE, width = NULL) 26 | 27 | toggle(input_id, label = "", is_marked = TRUE, style = NULL) 28 | } 29 | \arguments{ 30 | \item{input_id}{Input name. Reactive value is available under input[[name]].} 31 | 32 | \item{label}{Text to be displayed with checkbox.} 33 | 34 | \item{type}{Type of checkbox: NULL, 'toggle'} 35 | 36 | \item{is_marked}{Defines if checkbox should be marked. Default TRUE.} 37 | 38 | \item{style}{Style of the widget.} 39 | 40 | \item{inputId}{same as \code{input_id}} 41 | 42 | \item{value}{same as \code{is_marked}} 43 | 44 | \item{width}{The width of the input (currently not supported, but check \code{style})} 45 | } 46 | \description{ 47 | Create Semantic UI checkbox 48 | } 49 | \details{ 50 | The inputs are updateable by using \code{\link[shiny]{updateCheckboxInput}}. 51 | 52 | The following \code{type}s are allowed: 53 | \itemize{ 54 | \item{NULL} The standard checkbox (default) 55 | \item{toggle} Each checkbox has a toggle form 56 | \item{slider} Each checkbox has a simple slider form 57 | } 58 | } 59 | \examples{ 60 | if (interactive()){ 61 | ui <- shinyUI( 62 | semanticPage( 63 | p("Simple checkbox:"), 64 | checkbox_input("example", "Check me", is_marked = FALSE), 65 | p(), 66 | p("Simple toggle:"), 67 | toggle("tog1", "My Label", TRUE) 68 | ) 69 | ) 70 | server <- function(input, output, session) { 71 | observeEvent(input$tog1, { 72 | print(input$tog1) 73 | }) 74 | } 75 | shinyApp(ui, server) 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /man/counterbutton.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/button.R 3 | \name{counter_button} 4 | \alias{counter_button} 5 | \title{Counter Button} 6 | \usage{ 7 | counter_button( 8 | input_id, 9 | label = "", 10 | icon = NULL, 11 | value = 0, 12 | color = "", 13 | size = "", 14 | big_mark = " " 15 | ) 16 | } 17 | \arguments{ 18 | \item{input_id}{The \code{input} slot that will be used to access the value.} 19 | 20 | \item{label}{the content of the item to display} 21 | 22 | \item{icon}{an optional \code{\link{icon}()} to appear on the button.} 23 | 24 | \item{value}{initial rating value (integer)} 25 | 26 | \item{color}{character with semantic color} 27 | 28 | \item{size}{character with size of the button, eg. "medium", "big"} 29 | 30 | \item{big_mark}{big numbers separator} 31 | } 32 | \value{ 33 | counter button object 34 | } 35 | \description{ 36 | Creates a counter button whose value increments by one each time it is pressed. 37 | } 38 | \examples{ 39 | if (interactive()) { 40 | library(shiny) 41 | library(shiny.semantic) 42 | ui <-semanticPage( 43 | counter_button("counter", "My Counter Button", 44 | icon = icon("world"), 45 | size = "big", color = "purple") 46 | ) 47 | server <- function(input, output) { 48 | observeEvent(input$counter,{ 49 | print(input$counter) 50 | }) 51 | } 52 | shinyApp(ui, server) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /man/create_modal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modal.R 3 | \name{create_modal} 4 | \alias{create_modal} 5 | \alias{showModal} 6 | \title{Allows for the creation of modals in the server side without being tied to a specific HTML element.} 7 | \usage{ 8 | create_modal( 9 | ui_modal, 10 | show = TRUE, 11 | session = shiny::getDefaultReactiveDomain() 12 | ) 13 | 14 | showModal(ui, session = shiny::getDefaultReactiveDomain()) 15 | } 16 | \arguments{ 17 | \item{ui_modal}{HTML containing the modal.} 18 | 19 | \item{show}{If the modal should only be created or open when called (open by default).} 20 | 21 | \item{session}{Current session.} 22 | 23 | \item{ui}{Same as \code{ui_modal} in show modal} 24 | } 25 | \description{ 26 | Allows for the creation of modals in the server side without being tied to a specific HTML element. 27 | } 28 | \seealso{ 29 | modal 30 | } 31 | -------------------------------------------------------------------------------- /man/data_frame_to_css_grid_template_areas.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/grid.R 3 | \name{data_frame_to_css_grid_template_areas} 4 | \alias{data_frame_to_css_grid_template_areas} 5 | \title{Generate CSS string representing grid template areas.} 6 | \usage{ 7 | data_frame_to_css_grid_template_areas(areas_dataframe) 8 | } 9 | \arguments{ 10 | \item{areas_dataframe}{data.frame of character representing grid areas} 11 | } 12 | \value{ 13 | character 14 | } 15 | \description{ 16 | Generate CSS string representing grid template areas. 17 | } 18 | \details{ 19 | This is a helper function used in grid_template() 20 | 21 | \preformatted{ 22 | areas_dataframe <- rbind( 23 | c("header", "header", "header"), 24 | c("menu", "main", "right1"), 25 | c("menu", "main", "right2") 26 | ) 27 | 28 | result == "'header header header' 'menu main right1' 'menu main right2'" 29 | } 30 | } 31 | \keyword{internal} 32 | -------------------------------------------------------------------------------- /man/date_input.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/date_input.R 3 | \name{date_input} 4 | \alias{date_input} 5 | \alias{dateInput} 6 | \title{Define simple date input with Semantic UI styling} 7 | \usage{ 8 | date_input( 9 | input_id, 10 | label = NULL, 11 | value = NULL, 12 | min = NULL, 13 | max = NULL, 14 | style = NULL, 15 | icon_name = "calendar" 16 | ) 17 | 18 | dateInput( 19 | inputId, 20 | label = NULL, 21 | icon = NULL, 22 | value = NULL, 23 | min = NULL, 24 | max = NULL, 25 | width = NULL, 26 | ... 27 | ) 28 | } 29 | \arguments{ 30 | \item{input_id}{Input id.} 31 | 32 | \item{label}{Label to be displayed with date input.} 33 | 34 | \item{value}{Default date chosen for input.} 35 | 36 | \item{min}{Minimum date that can be selected.} 37 | 38 | \item{max}{Maximum date that can be selected.} 39 | 40 | \item{style}{Css style for widget.} 41 | 42 | \item{icon_name}{Icon that should be displayed on widget.} 43 | 44 | \item{inputId}{Input id.} 45 | 46 | \item{icon}{Icon that should be displayed on widget.} 47 | 48 | \item{width}{character width of the object} 49 | 50 | \item{...}{other arguments} 51 | } 52 | \description{ 53 | Define simple date input with Semantic UI styling 54 | } 55 | \examples{ 56 | if (interactive()) { 57 | # Below example shows how to implement simple date range input using \code{date_input} 58 | 59 | library(shiny) 60 | library(shiny.semantic) 61 | 62 | ui <- shinyUI( 63 | semanticPage( 64 | title = "Date range example", 65 | uiOutput("date_range"), 66 | p("Selected dates:"), 67 | textOutput("selected_dates") 68 | ) 69 | ) 70 | 71 | server <- shinyServer(function(input, output, session) { 72 | output$date_range <- renderUI({ 73 | tagList( 74 | tags$div(tags$div(HTML("From")), 75 | date_input("date_from", value = Sys.Date() - 30, style = "width: 10\%;")), 76 | tags$div(tags$div(HTML("To")), 77 | date_input("date_to", value = Sys.Date(), style = "width: 10\%;")) 78 | ) 79 | }) 80 | 81 | output$selected_dates <- renderPrint({ 82 | c(input$date_from, input$date_to) 83 | }) 84 | }) 85 | 86 | shinyApp(ui = ui, server = server) 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /man/define_selection_type.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/semantic_search.R 3 | \name{define_selection_type} 4 | \alias{define_selection_type} 5 | \title{Define search type if multiple} 6 | \usage{ 7 | define_selection_type(input_id, multiple) 8 | } 9 | \arguments{ 10 | \item{input_id}{character with name} 11 | 12 | \item{multiple}{multiple flag} 13 | } 14 | \description{ 15 | Define search type if multiple 16 | } 17 | \keyword{internal} 18 | -------------------------------------------------------------------------------- /man/digits2words.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/menu.R 3 | \name{digits2words} 4 | \alias{digits2words} 5 | \title{Helper function that transforms digits to words} 6 | \usage{ 7 | digits2words(number) 8 | } 9 | \arguments{ 10 | \item{number}{numeric digits from 1 to 10} 11 | } 12 | \value{ 13 | character with number word 14 | } 15 | \description{ 16 | Helper function that transforms digits to words 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/display_grid.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/grid.R 3 | \name{display_grid} 4 | \alias{display_grid} 5 | \title{Display grid template in a browser for easy debugging} 6 | \usage{ 7 | display_grid(grid_template) 8 | } 9 | \arguments{ 10 | \item{grid_template}{generated by grid_template() function} 11 | } 12 | \description{ 13 | Display grid template in a browser for easy debugging 14 | } 15 | \details{ 16 | Opens a browser and displays grid template with styled border to highlight existing areas. 17 | 18 | Warning: CSS can't be displayed in RStudio viewer pane. CSS grid is supported only by modern browsers. 19 | You can see list of supported browsers here: https://www.w3schools.com/css/css_grid.asp 20 | } 21 | -------------------------------------------------------------------------------- /man/dot-onLoad.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/shiny.R 3 | \name{.onLoad} 4 | \alias{.onLoad} 5 | \title{Internal function that expose javascript bindings to Shiny app.} 6 | \usage{ 7 | .onLoad(libname, pkgname) 8 | } 9 | \arguments{ 10 | \item{libname}{library name} 11 | 12 | \item{pkgname}{package name} 13 | } 14 | \description{ 15 | Internal function that expose javascript bindings to Shiny app. 16 | } 17 | \keyword{internal} 18 | -------------------------------------------------------------------------------- /man/dropdown_input.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dropdown.R 3 | \name{dropdown_input} 4 | \alias{dropdown_input} 5 | \title{Create dropdown Semantic UI component} 6 | \usage{ 7 | dropdown_input( 8 | input_id, 9 | choices, 10 | choices_value = choices, 11 | default_text = "Select", 12 | value = NULL, 13 | type = "selection fluid" 14 | ) 15 | } 16 | \arguments{ 17 | \item{input_id}{Input name. Reactive value is available under input[[input_id]].} 18 | 19 | \item{choices}{All available options one can select from.} 20 | 21 | \item{choices_value}{What reactive value should be used for corresponding 22 | choice.} 23 | 24 | \item{default_text}{Text to be visible on dropdown when nothing is selected.} 25 | 26 | \item{value}{Pass value if you want to initialize selection for dropdown.} 27 | 28 | \item{type}{Change depending what type of dropdown is wanted.} 29 | } 30 | \description{ 31 | This creates a default *dropdown_input* using Semantic UI styles with Shiny input. 32 | Dropdown is already initialized and available under input[[input_id]]. 33 | } 34 | \examples{ 35 | ## Only run examples in interactive R sessions 36 | if (interactive()) { 37 | library(shiny) 38 | library(shiny.semantic) 39 | ui <- semanticPage( 40 | title = "Dropdown example", 41 | dropdown_input("simple_dropdown", LETTERS, value = "A"), 42 | p("Selected letter:"), 43 | textOutput("dropdown") 44 | ) 45 | server <- function(input, output) { 46 | output$dropdown <- renderText(input[["simple_dropdown"]]) 47 | } 48 | 49 | shinyApp(ui = ui, server = server) 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /man/dropdown_menu.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{dropdown_menu} 4 | \alias{dropdown_menu} 5 | \title{Create Semantic UI Dropdown} 6 | \usage{ 7 | dropdown_menu( 8 | ..., 9 | class = "", 10 | name, 11 | is_menu_item = FALSE, 12 | dropdown_specs = list() 13 | ) 14 | } 15 | \arguments{ 16 | \item{...}{Dropdown content.} 17 | 18 | \item{class}{class of the dropdown. Look at https://semantic-ui.com/modules/dropdown.html for all possibilities.} 19 | 20 | \item{name}{Unique name of the created dropdown.} 21 | 22 | \item{is_menu_item}{TRUE if the dropdown is a menu item. Default is FALSE.} 23 | 24 | \item{dropdown_specs}{A list of dropdown functionalities. 25 | Look at https://semantic-ui.com/modules/dropdown.html#/settings for all possibilities.} 26 | } 27 | \description{ 28 | This creates a dropdown using Semantic UI. 29 | } 30 | \examples{ 31 | ## Only run examples in interactive R sessions 32 | if (interactive()){ 33 | library(shiny) 34 | library(shiny.semantic) 35 | 36 | ui <- shinyUI(semanticPage( 37 | dropdown_menu( 38 | "Dropdown menu", 39 | icon(class = "dropdown"), 40 | menu( 41 | menu_header("Header"), 42 | menu_divider(), 43 | menu_item("Option 1"), 44 | menu_item("Option 2") 45 | ), 46 | name = "dropdown_menu", 47 | dropdown_specs = list("duration: 500") 48 | ) 49 | 50 | )) 51 | server <- shinyServer(function(input, output) { 52 | }) 53 | 54 | shinyApp(ui, server) 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /man/extract_icon_name.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{extract_icon_name} 4 | \alias{extract_icon_name} 5 | \title{Extract icon name} 6 | \usage{ 7 | extract_icon_name(icon) 8 | } 9 | \arguments{ 10 | \item{icon}{icon object} 11 | } 12 | \value{ 13 | character with icon name 14 | } 15 | \description{ 16 | Extract icon name 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/field.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{field} 4 | \alias{field} 5 | \title{Create Semantic UI field tag} 6 | \usage{ 7 | field(..., class = "") 8 | } 9 | \arguments{ 10 | \item{...}{Other arguments to be added as attributes of the 11 | tag (e.g. style, class or childrens etc.)} 12 | 13 | \item{class}{Additional classes to add to html tag.} 14 | } 15 | \description{ 16 | This creates a field tag using Semantic UI styles. 17 | } 18 | \examples{ 19 | ## Only run examples in interactive R sessions 20 | if (interactive()){ 21 | library(shiny) 22 | library(shiny.semantic) 23 | 24 | ui <- shinyUI(semanticPage( 25 | form( 26 | field( 27 | tags$label("Name"), 28 | text_input("name", value = "", type = "text", placeholder = "Enter Name...") 29 | ), 30 | # error field 31 | field( 32 | class = "error", 33 | tags$label("Name"), 34 | text_input("name", value = "", type = "text", placeholder = "Enter Name...") 35 | ), 36 | # disabled 37 | field( 38 | class = "disabled", 39 | tags$label("Name"), 40 | text_input("name", value = "", type = "text", placeholder = "Enter Name...") 41 | ) 42 | ) 43 | )) 44 | server <- shinyServer(function(input, output) { 45 | }) 46 | 47 | shinyApp(ui, server) 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /man/fields.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{fields} 4 | \alias{fields} 5 | \title{Create Semantic UI fields tag} 6 | \usage{ 7 | fields(..., class = "") 8 | } 9 | \arguments{ 10 | \item{...}{Other arguments to be added as attributes of the 11 | tag (e.g. style, class or childrens etc.)} 12 | 13 | \item{class}{Additional classes to add to html tag.} 14 | } 15 | \description{ 16 | This creates a fields tag using Semantic UI styles. 17 | } 18 | \examples{ 19 | ## Only run examples in interactive R sessions 20 | if (interactive()){ 21 | library(shiny) 22 | library(shiny.semantic) 23 | 24 | ui <- shinyUI(semanticPage( 25 | form( 26 | fields(class = "two", 27 | field( 28 | tags$label("Name"), 29 | text_input("name", value = "", type = "text", placeholder = "Enter Name...") 30 | ), 31 | field( 32 | tags$label("Surname"), 33 | text_input("surname", value = "", type = "text", placeholder = "Enter Surname...") 34 | )) 35 | ) 36 | )) 37 | server <- shinyServer(function(input, output) { 38 | }) 39 | 40 | shinyApp(ui, server) 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /man/figures/after_wq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/man/figures/after_wq.png -------------------------------------------------------------------------------- /man/figures/before_wq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/man/figures/before_wq.png -------------------------------------------------------------------------------- /man/figures/churn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/man/figures/churn.png -------------------------------------------------------------------------------- /man/figures/fraud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/man/figures/fraud.png -------------------------------------------------------------------------------- /man/figures/hexsticker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/man/figures/hexsticker.png -------------------------------------------------------------------------------- /man/figures/semantic_components.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/man/figures/semantic_components.png -------------------------------------------------------------------------------- /man/figures/ss_after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/man/figures/ss_after.png -------------------------------------------------------------------------------- /man/figures/ss_before.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/man/figures/ss_before.png -------------------------------------------------------------------------------- /man/file_input.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/input.R 3 | \name{file_input} 4 | \alias{file_input} 5 | \alias{fileInput} 6 | \title{Create Semantic UI File Input} 7 | \usage{ 8 | file_input( 9 | input_id, 10 | label, 11 | multiple = FALSE, 12 | accept = NULL, 13 | button_label = "Browse...", 14 | type = NULL, 15 | placeholder = "no file selected", 16 | ... 17 | ) 18 | 19 | fileInput( 20 | inputId, 21 | label, 22 | multiple = FALSE, 23 | accept = NULL, 24 | width = NULL, 25 | buttonLabel = "Browse...", 26 | placeholder = "No file selected", 27 | ... 28 | ) 29 | } 30 | \arguments{ 31 | \item{input_id, inputId}{Input name. Reactive value is available under \code{input[[input_id]]}.} 32 | 33 | \item{label}{Display label for the control, or NULL for no label.} 34 | 35 | \item{multiple}{Whether the user should be allowed to select and upload multiple files at once.} 36 | 37 | \item{accept}{A character vector of "unique file type specifiers" which gives the browser a hint as to the type 38 | of file the server expects. Many browsers use this prevent the user from selecting an invalid file.} 39 | 40 | \item{button_label, buttonLabel}{Display label for the button.} 41 | 42 | \item{type}{Input type specifying class attached to input container. 43 | See [Fomantic UI](https://fomantic-ui.com/collections/form.html) for details.} 44 | 45 | \item{placeholder}{Inner input label displayed when no file has been uploaded.} 46 | 47 | \item{...}{Other parameters passed from \code{fileInput} to \code{file_input} like \code{type}.} 48 | 49 | \item{width}{The width of the input, e.g. \code{'400px'}, or \code{'100\%'}.} 50 | } 51 | \description{ 52 | This creates a default file input using Semantic UI. The input is available 53 | under \code{input[[input_id]]}. 54 | } 55 | \examples{ 56 | ## Only run examples in interactive R sessions 57 | if (interactive()) { 58 | library(shiny) 59 | library(shiny.semantic) 60 | ui <- semanticPage( 61 | form( 62 | div( 63 | class = "ui grid", 64 | div( 65 | class = "four wide column", 66 | file_input("ex", "Select file"), 67 | header("File type selected:", textOutput("ex_file")) 68 | ) 69 | ) 70 | ) 71 | ) 72 | server <- function(input, output, session) { 73 | output$ex_file <- renderText({ 74 | if (is.null(input)) return("No file uploaded") 75 | tools::file_ext(input$ex$datapath) 76 | }) 77 | } 78 | shinyApp(ui, server) 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /man/flow_layout.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/layouts.R 3 | \name{flow_layout} 4 | \alias{flow_layout} 5 | \alias{flowLayout} 6 | \title{Flow layout} 7 | \usage{ 8 | flow_layout( 9 | ..., 10 | cell_args = list(), 11 | min_cell_width = "208px", 12 | max_cell_width = "1fr", 13 | column_gap = "12px", 14 | row_gap = "0px" 15 | ) 16 | 17 | flowLayout(..., cellArgs = list()) 18 | } 19 | \arguments{ 20 | \item{...}{Unnamed arguments will become child elements of the layout. 21 | Named arguments will become HTML attributes on the outermost tag.} 22 | 23 | \item{cell_args}{Any additional attributes that should be used for each cell 24 | of the layout.} 25 | 26 | \item{min_cell_width}{The minimum width of the cells.} 27 | 28 | \item{max_cell_width}{The maximum width of the cells.} 29 | 30 | \item{column_gap}{The spacing between columns.} 31 | 32 | \item{row_gap}{The spacing between rows.} 33 | 34 | \item{cellArgs}{Same as \code{cell_args}.} 35 | } 36 | \description{ 37 | Lays out elements in a left-to-right, top-to-bottom arrangement. 38 | The elements on a given row will be top-aligned with each other. 39 | } 40 | \details{ 41 | The width of the elements and spacing between them is configurable. 42 | Lengths can be given as numeric values (interpreted as pixels) 43 | or character values (interpreted as CSS lengths). 44 | With the default settings this layout closely resembles the \code{flowLayout} 45 | from Shiny. 46 | } 47 | \examples{ 48 | if (interactive()) { 49 | ui <- semanticPage( 50 | flow_layout( 51 | numericInput("rows", "How many rows?", 5), 52 | selectInput("letter", "Which letter?", LETTERS), 53 | sliderInput("value", "What value?", 0, 100, 50) 54 | ) 55 | ) 56 | shinyApp(ui, server = function(input, output) {}) 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /man/form.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{form} 4 | \alias{form} 5 | \title{Create Semantic UI form tag} 6 | \usage{ 7 | form(..., class = "") 8 | } 9 | \arguments{ 10 | \item{...}{Other arguments to be added as attributes of the 11 | tag (e.g. style, class or childrens etc.)} 12 | 13 | \item{class}{Additional classes to add to html tag.} 14 | } 15 | \description{ 16 | This creates a form tag using Semantic UI styles. 17 | } 18 | \examples{ 19 | ## Only run examples in interactive R sessions 20 | if (interactive()){ 21 | library(shiny) 22 | library(shiny.semantic) 23 | 24 | ui <- shinyUI(semanticPage( 25 | form( 26 | field( 27 | tags$label("Text"), 28 | text_input("text_ex", value = "", type = "text", placeholder = "Enter Text...") 29 | ) 30 | ), 31 | # loading form 32 | form(class = "loading form", 33 | field( 34 | tags$label("Text"), 35 | text_input("text_ex", value = "", type = "text", placeholder = "Enter Text...") 36 | )), 37 | # size variations mini form 38 | form(class = "mini", 39 | field( 40 | tags$label("Text"), 41 | text_input("text_ex", value = "", type = "text", placeholder = "Enter Text...") 42 | )), 43 | # massive 44 | form(class = "massive", 45 | field( 46 | tags$label("Text"), 47 | text_input("text_ex", value = "", type = "text", placeholder = "Enter Text...") 48 | )) 49 | )) 50 | server <- shinyServer(function(input, output) { 51 | }) 52 | 53 | shinyApp(ui, server) 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /man/generate_random_id.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{generate_random_id} 4 | \alias{generate_random_id} 5 | \title{Some elements require input id, but this does not need to be 6 | specified by the user. Thus we assign random value with prefix where needed.} 7 | \usage{ 8 | generate_random_id(prefix, id_length = 20) 9 | } 10 | \arguments{ 11 | \item{prefix}{character with prefix add to id} 12 | 13 | \item{id_length}{numeric with length of id (default 20)} 14 | } 15 | \description{ 16 | Some elements require input id, but this does not need to be 17 | specified by the user. Thus we assign random value with prefix where needed. 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/get_css_file.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/semanticPage.R 3 | \name{get_css_file} 4 | \alias{get_css_file} 5 | \title{Get css file} 6 | \usage{ 7 | get_css_file(type, theme = NULL, minified = NULL) 8 | } 9 | \arguments{ 10 | \item{type}{define type of dependencies source} 11 | 12 | \item{theme}{define theme} 13 | 14 | \item{minified}{define if minified version should be used} 15 | } 16 | \value{ 17 | css file name 18 | } 19 | \description{ 20 | Get css file 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/get_dependencies.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/semanticPage.R 3 | \name{get_dependencies} 4 | \alias{get_dependencies} 5 | \title{Add dashboard dependencies to html} 6 | \usage{ 7 | get_dependencies(theme = NULL) 8 | } 9 | \arguments{ 10 | \item{theme}{define theme} 11 | } 12 | \value{ 13 | Content with appended dependencies. 14 | } 15 | \description{ 16 | Internal function that adds dashboard dependencies to html. 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/get_dependencies_path.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/semanticPage.R 3 | \name{get_dependencies_path} 4 | \alias{get_dependencies_path} 5 | \title{Get dependencies path} 6 | \usage{ 7 | get_dependencies_path() 8 | } 9 | \value{ 10 | path with css and js files 11 | } 12 | \description{ 13 | Get dependencies path 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/get_numeric.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/layouts.R 3 | \name{get_numeric} 4 | \alias{get_numeric} 5 | \title{Extracts numeric values} 6 | \usage{ 7 | get_numeric(value) 8 | } 9 | \arguments{ 10 | \item{value}{Value to be converted to numeric} 11 | } 12 | \value{ 13 | Numeric value 14 | } 15 | \description{ 16 | Extracts numeric values 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/grapes-colon-colon-colon-grapes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{\%:::\%} 4 | \alias{\%:::\%} 5 | \title{::: hack solution to pass CRAN checks} 6 | \usage{ 7 | pkg \%:::\% name 8 | } 9 | \arguments{ 10 | \item{pkg}{package name} 11 | 12 | \item{name}{function name} 13 | } 14 | \value{ 15 | function 16 | } 17 | \description{ 18 | ::: hack solution to pass CRAN checks 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/grid.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/grid.R 3 | \name{grid} 4 | \alias{grid} 5 | \title{Use CSS grid template in Shiny UI} 6 | \usage{ 7 | grid( 8 | grid_template, 9 | id = paste(sample(letters, 5), collapse = ""), 10 | container_style = "", 11 | area_styles = list(), 12 | display_mode = FALSE, 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{grid_template}{grid template created with grid_template() function} 18 | 19 | \item{id}{id of grid} 20 | 21 | \item{container_style}{character - string of custom CSS for the main grid container} 22 | 23 | \item{area_styles}{list of custom CSS styles for provided area names} 24 | 25 | \item{display_mode}{replaces areas HTML content with text. Used by display_grid() function} 26 | 27 | \item{...}{areas HTML content provided by named arguments} 28 | } 29 | \value{ 30 | Rendered HTML ready to use by Shiny UI. See \code{htmltools::htmlTemplate()} for more details. 31 | } 32 | \description{ 33 | Use CSS grid template in Shiny UI 34 | } 35 | \details{ 36 | Grids can be nested. 37 | } 38 | \examples{ 39 | myGrid <- grid_template(default = list( 40 | areas = rbind( 41 | c("header", "header", "header"), 42 | c("menu", "main", "right1"), 43 | c("menu", "main", "right2") 44 | ), 45 | rows_height = c("50px", "auto", "100px"), 46 | cols_width = c("100px", "2fr", "1fr") 47 | )) 48 | 49 | subGrid <- grid_template(default = list( 50 | areas = rbind( 51 | c("top_left", "top_right"), 52 | c("bottom_left", "bottom_right") 53 | ), 54 | rows_height = c("50\%", "50\%"), 55 | cols_width = c("50\%", "50\%") 56 | )) 57 | 58 | if (interactive()){ 59 | library(shiny) 60 | library(shiny.semantic) 61 | shinyApp( 62 | ui = semanticPage( 63 | grid(myGrid, 64 | container_style = "border: 1px solid #f00", 65 | area_styles = list(header = "background: #0099f9", 66 | menu = "border-right: 1px solid #0099f9"), 67 | header = div(shiny::tags$h1("Hello CSS Grid!")), 68 | menu = checkbox_input("example", "Check me", is_marked = FALSE), 69 | main = grid(subGrid, 70 | top_left = calendar("my_calendar"), 71 | top_right = div("hello 1"), 72 | bottom_left = div("hello 2"), 73 | bottom_right = div("hello 3") 74 | ), 75 | right1 = div( 76 | toggle("toggle", "let's toggle"), 77 | multiple_checkbox("mycheckbox", "mycheckbox", 78 | c("option A","option B","option C"))), 79 | right2 = div("right 2") 80 | ) 81 | ), 82 | server = shinyServer(function(input, output) {}) 83 | ) 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /man/grid_container_css.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/grid.R 3 | \name{grid_container_css} 4 | \alias{grid_container_css} 5 | \title{Generate template string representing CSS styles of grid container div.} 6 | \usage{ 7 | grid_container_css(css_grid_template_areas, rows_height, cols_width) 8 | } 9 | \arguments{ 10 | \item{css_grid_template_areas}{character, CSS value for grid-template-areas} 11 | 12 | \item{rows_height}{vector of character} 13 | 14 | \item{cols_width}{vector of character} 15 | } 16 | \value{ 17 | character 18 | } 19 | \description{ 20 | Generate template string representing CSS styles of grid container div. 21 | } 22 | \details{ 23 | This is a helper function used in grid_template() 24 | \preformatted{ 25 | grid_container_css( 26 | "'a a a' 'b b b'", 27 | c("50\%", "50\%"), 28 | c("100px", "2fr", "1fr") 29 | ) 30 | } 31 | returns 32 | \preformatted{ 33 | "display: grid; 34 | height: 100\%; 35 | grid-template-rows: 50\% 50\%; 36 | grid-template-columns: 100px 2fr 1fr; 37 | grid-template-areas: 'a a a' 'b b b'; 38 | {{ custom_style_grid_container }}" 39 | } 40 | } 41 | \keyword{internal} 42 | -------------------------------------------------------------------------------- /man/grid_template.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/grid.R 3 | \name{grid_template} 4 | \alias{grid_template} 5 | \title{Define a template of a CSS grid} 6 | \usage{ 7 | grid_template(default = NULL, mobile = NULL) 8 | } 9 | \arguments{ 10 | \item{default}{(required) 11 | Template for desktop: 12 | list(areas = [data.frame of character], 13 | rows_height = [vector of character], 14 | cols_width = [vector of character])} 15 | 16 | \item{mobile}{(optional) 17 | Template for mobile (screen width below 768px): 18 | list(areas = [data.frame of character], 19 | rows_height = [vector of character], 20 | cols_width = [vector of character])} 21 | } 22 | \value{ 23 | list(template = [character], area_names = [vector of character]) 24 | 25 | template - contains template that can be parsed by htmlTemplate() function 26 | 27 | area_names - contains all unique area names used in grid definition 28 | } 29 | \description{ 30 | Define a template of a CSS grid 31 | } 32 | \examples{ 33 | myGrid <- grid_template( 34 | default = list( 35 | areas = rbind( 36 | c("header", "header", "header"), 37 | c("menu", "main", "right1"), 38 | c("menu", "main", "right2") 39 | ), 40 | rows_height = c("50px", "auto", "100px"), 41 | cols_width = c("100px", "2fr", "1fr") 42 | ), 43 | mobile = list( 44 | areas = rbind( 45 | "header", 46 | "menu", 47 | "main", 48 | "right1", 49 | "right2" 50 | ), 51 | rows_height = c("50px", "50px", "auto", "150px", "150px"), 52 | cols_width = c("100\%") 53 | ) 54 | ) 55 | if (interactive()) display_grid(myGrid) 56 | subGrid <- grid_template(default = list( 57 | areas = rbind( 58 | c("top_left", "top_right"), 59 | c("bottom_left", "bottom_right") 60 | ), 61 | rows_height = c("50\%", "50\%"), 62 | cols_width = c("50\%", "50\%") 63 | )) 64 | 65 | if (interactive()) display_grid(subGrid) 66 | } 67 | -------------------------------------------------------------------------------- /man/header.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{header} 4 | \alias{header} 5 | \title{Create Semantic UI header} 6 | \usage{ 7 | header(title, description, icon = NULL) 8 | } 9 | \arguments{ 10 | \item{title}{Header title} 11 | 12 | \item{description}{Subheader text} 13 | 14 | \item{icon}{Optional icon name} 15 | } 16 | \description{ 17 | This creates a header with optional icon using Semantic UI styles. 18 | } 19 | \examples{ 20 | ## Only run examples in interactive R sessions 21 | if (interactive()){ 22 | library(shiny) 23 | library(shiny.semantic) 24 | 25 | ui <- shinyUI(semanticPage( 26 | header(title = "Header with description", description = "Description"), 27 | header(title = "Header with icon", description = "Description", icon = "dog") 28 | )) 29 | server <- shinyServer(function(input, output) { 30 | }) 31 | 32 | shinyApp(ui, server) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /man/horizontal_menu.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/menu.R 3 | \name{horizontal_menu} 4 | \alias{horizontal_menu} 5 | \title{Horizontal menu} 6 | \usage{ 7 | horizontal_menu(menu_items, active_location = "", logo = NULL) 8 | } 9 | \arguments{ 10 | \item{menu_items}{list with list that can have fields: "name" (mandatory), 11 | "link" and "icon"} 12 | 13 | \item{active_location}{active location of the menu (should match 14 | one from "link")} 15 | 16 | \item{logo}{optional argument that displays logo on the left 17 | of horizontal menu, can be character with image location, or shiny image object} 18 | } 19 | \value{ 20 | shiny div with horizontal menu 21 | } 22 | \description{ 23 | Renders UI with horizontal menu 24 | } 25 | \examples{ 26 | library(shiny.semantic) 27 | menu_content <- list( 28 | list(name = "AA", link = "http://example.com", icon = "dog"), 29 | list(name = "BB", link = "#", icon="cat"), 30 | list(name = "CC") 31 | ) 32 | if (interactive()){ 33 | ui <- semanticPage( 34 | horizontal_menu(menu_content) 35 | ) 36 | server <- function(input, output, session) {} 37 | shinyApp(ui, server) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /man/icon.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{icon} 4 | \alias{icon} 5 | \title{Create Semantic UI icon tag} 6 | \usage{ 7 | icon(class = "", ...) 8 | } 9 | \arguments{ 10 | \item{class}{A name of an icon. Look at 11 | http://semantic-ui.com/elements/icon.html for all possibilities.} 12 | 13 | \item{...}{Other arguments to be added as attributes of the 14 | tag (e.g. style, class etc.)} 15 | } 16 | \description{ 17 | This creates an icon tag using Semantic UI styles. 18 | } 19 | \examples{ 20 | 21 | if (interactive()){ 22 | library(shiny) 23 | library(shiny.semantic) 24 | 25 | ui <- function() { 26 | shinyUI( 27 | semanticPage( 28 | # Basic icon 29 | icon("home"), 30 | br(), 31 | # Different size 32 | icon("small home"), 33 | icon("large home"), 34 | br(), 35 | # Disabled icon 36 | icon("disabled home"), 37 | br(), 38 | # Loading icon 39 | icon("spinner loading"), 40 | br(), 41 | # Icon formatted as link 42 | icon("close link"), 43 | br(), 44 | # Flipped 45 | icon("horizontally flipped cloud"), 46 | icon("vertically flipped cloud"), 47 | br(), 48 | # Rotated 49 | icon("clockwise rotated cloud"), 50 | icon("counterclockwise rotated cloud"), 51 | br(), 52 | # Circular 53 | icon("circular home"), 54 | br(), 55 | # Bordered 56 | icon("bordered home"), 57 | br(), 58 | # Colored 59 | icon("red home"), 60 | br(), 61 | # inverted 62 | segment(class = "inverted", icon("inverted home")) 63 | ) 64 | ) 65 | } 66 | 67 | server <- shinyServer(function(input, output, session) { 68 | 69 | }) 70 | 71 | shinyApp(ui = ui(), server = server) 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /man/label.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{label} 4 | \alias{label} 5 | \title{Create Semantic UI label tag} 6 | \usage{ 7 | label(..., class = "", is_link = TRUE) 8 | } 9 | \arguments{ 10 | \item{...}{Other arguments to be added such as content of the tag (text, icons) and/or attributes (style)} 11 | 12 | \item{class}{class of the label. Look at https://semantic-ui.com/elements/label.html for all possibilities.} 13 | 14 | \item{is_link}{If TRUE creates label with 'a' tag, otherwise with 'div' tag. 15 | #'} 16 | } 17 | \description{ 18 | This creates a \code{div} or \code{a} tag with with class \code{ui label} using Semantic UI. 19 | } 20 | \examples{ 21 | ## Only run examples in interactive R sessions 22 | if (interactive()){ 23 | library(shiny) 24 | library(shiny.semantic) 25 | 26 | ui <- shinyUI( 27 | semanticPage( 28 | ## label 29 | label(icon = icon("mail icon"), 23), 30 | p(), 31 | ## pointing label 32 | field( 33 | text_input("ex", label = "", type = "text", placeholder = "Your name")), 34 | label("Please enter a valid name", class = "pointing red basic"), 35 | p(), 36 | ## tag 37 | label(class = "tag", "New"), 38 | label(class = "red tag", "Upcoming"), 39 | label(class =" teal tag","Featured"), 40 | ## ribbon 41 | segment(class = "ui raised segment", 42 | label(class = "ui red ribbon", "Overview"), 43 | "Text"), 44 | ## attached 45 | segment(class = "ui raised segment", 46 | label(class = "top attached", "HTML"), 47 | p("Text")) 48 | )) 49 | server <- function(input, output, session) { 50 | } 51 | shinyApp(ui, server) 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /man/list_container.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{list_container} 4 | \alias{list_container} 5 | \title{Create Semantic UI list with header, description and icons} 6 | \usage{ 7 | list_container(content_list, is_divided = FALSE) 8 | } 9 | \arguments{ 10 | \item{content_list}{list of lists with fields: `header` and/or `description`, 11 | `icon` containing the list items headers, descriptions (one of these is mandatory) 12 | and icons. Icon column should contain strings with icon names available 13 | here: https://fomantic-ui.com/elements/icon.html} 14 | 15 | \item{is_divided}{If TRUE created list elements are divided} 16 | } 17 | \description{ 18 | This creates a list with icons using Semantic UI 19 | } 20 | \examples{ 21 | library(shiny) 22 | library(shiny.semantic) 23 | list_content <- list( 24 | list(header = "Head", description = "Lorem ipsum", icon = "cat"), 25 | list(header = "Head 2", icon = "tree"), 26 | list(description = "Lorem ipsum 2", icon = "dog") 27 | ) 28 | if (interactive()){ 29 | ui <- semanticPage( 30 | list_container(list_content, is_divided = TRUE) 31 | ) 32 | server <- function(input, output) {} 33 | shinyApp(ui, server) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /man/list_element.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{list_element} 4 | \alias{list_element} 5 | \title{Helper function to render list element} 6 | \usage{ 7 | list_element(header = NULL, description = NULL, icon_name = NULL) 8 | } 9 | \arguments{ 10 | \item{header}{character with header element} 11 | 12 | \item{description}{character with content of the list} 13 | 14 | \item{icon_name}{character with optional icon} 15 | } 16 | \description{ 17 | Helper function to render list element 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/list_of_area_tags.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/grid.R 3 | \name{list_of_area_tags} 4 | \alias{list_of_area_tags} 5 | \title{Generate list of HTML div elements representing grid areas.} 6 | \usage{ 7 | list_of_area_tags(area_names) 8 | } 9 | \arguments{ 10 | \item{area_names}{vector with area names} 11 | } 12 | \value{ 13 | list of \code{shiny::tags$div} 14 | } 15 | \description{ 16 | Generate list of HTML div elements representing grid areas. 17 | } 18 | \details{ 19 | This is a helper function used in grid_template() 20 | \preformatted{ 21 | list_of_area_tags(c("header", "main", "footer")) 22 | } 23 | returns the following list: 24 | \preformatted{ 25 | [[1]]
{{ header }}
26 | [[2]]
{{ main }}
27 | [[3]] 28 | } 29 | } 30 | \keyword{internal} 31 | -------------------------------------------------------------------------------- /man/menu.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{menu} 4 | \alias{menu} 5 | \title{Create Semantic UI Menu} 6 | \usage{ 7 | menu(..., class = "") 8 | } 9 | \arguments{ 10 | \item{...}{Menu items to be created. Use menu_item function to create new menu item. 11 | Use dropdown_menu(is_menu_item = TRUE, ...) function to create new dropdown menu item. 12 | Use menu_header and menu_divider functions to customize menu format.} 13 | 14 | \item{class}{Class extension.Look at https://semantic-ui.com/collections/menu.html 15 | for all possibilities.} 16 | } 17 | \description{ 18 | This creates a menu using Semantic UI. 19 | } 20 | \examples{ 21 | ## Only run examples in interactive R sessions 22 | if (interactive()) { 23 | library(shiny) 24 | library(shiny.semantic) 25 | 26 | ui <- function() { 27 | shinyUI( 28 | semanticPage( 29 | title = "My page", 30 | menu(menu_item("Menu"), 31 | dropdown_menu( 32 | "Action", 33 | menu( 34 | menu_header(icon("file"), "File", is_item = FALSE), 35 | menu_item(icon("wrench"), "Open"), 36 | menu_item(icon("upload"), "Upload"), 37 | menu_item(icon("remove"), "Upload"), 38 | menu_divider(), 39 | menu_header(icon("user"), "User", is_item = FALSE), 40 | menu_item(icon("add user"), "Add"), 41 | menu_item(icon("remove user"), "Remove")), 42 | class = "", 43 | name = "unique_name", 44 | is_menu_item = TRUE), 45 | menu_item(icon("user"), "Profile", href = "#index", item_feature = "active"), 46 | menu_item("Projects", href = "#projects"), 47 | menu_item(icon("users"), "Team"), 48 | menu(menu_item(icon("add icon"), "New tab"), class = "right")) 49 | ) 50 | ) 51 | } 52 | server <- shinyServer(function(input, output) {}) 53 | shinyApp(ui = ui(), server = server) 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /man/menu_divider.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{menu_divider} 4 | \alias{menu_divider} 5 | \title{Create Semantic UI Divider Item} 6 | \usage{ 7 | menu_divider(...) 8 | } 9 | \arguments{ 10 | \item{...}{Other attributes of the divider such as style.} 11 | } 12 | \description{ 13 | This creates a menu divider item using Semantic UI. 14 | } 15 | \seealso{ 16 | menu 17 | } 18 | -------------------------------------------------------------------------------- /man/menu_header.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{menu_header} 4 | \alias{menu_header} 5 | \title{Create Semantic UI Header Item} 6 | \usage{ 7 | menu_header(..., is_item = TRUE) 8 | } 9 | \arguments{ 10 | \item{...}{Content of the header: text, icons, etc.} 11 | 12 | \item{is_item}{If TRUE created header is item of Semantic UI Menu.} 13 | } 14 | \description{ 15 | This creates a dropdown header item using Semantic UI. 16 | } 17 | \seealso{ 18 | menu 19 | } 20 | -------------------------------------------------------------------------------- /man/menu_item.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{menu_item} 4 | \alias{menu_item} 5 | \title{Create Semantic UI Menu Item} 6 | \usage{ 7 | menu_item(..., item_feature = "", style = NULL, href = NULL) 8 | } 9 | \arguments{ 10 | \item{...}{Content of the menu item: text, icons or labels to be displayed.} 11 | 12 | \item{item_feature}{If required, add additional item feature like 'active', 'header', etc.} 13 | 14 | \item{style}{Style of the item, e.g. "text-align: center".} 15 | 16 | \item{href}{If NULL (default) menu_item is created with 'div' tag. Otherwise it is created with 'a' tag, and 17 | parameeter defines its href attribute.} 18 | } 19 | \description{ 20 | This creates a menu item using Semantic UI 21 | } 22 | \seealso{ 23 | menu 24 | } 25 | -------------------------------------------------------------------------------- /man/message_box.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{message_box} 4 | \alias{message_box} 5 | \title{Create Semantic UI Message box} 6 | \usage{ 7 | message_box(header, content, class = "", icon_name, closable = FALSE) 8 | } 9 | \arguments{ 10 | \item{header}{Header of the message box} 11 | 12 | \item{content}{Content of the message box . If it is a vector, creates a list 13 | of vector's elements} 14 | 15 | \item{class}{class of the message. Look at 16 | https://semantic-ui.com/collections/message.html for all possibilities.} 17 | 18 | \item{icon_name}{If the message is of the type 'icon', specify the icon. 19 | Look at http://semantic-ui.com/elements/icon.html for all possibilities.} 20 | 21 | \item{closable}{Determines whether the message should be closable. 22 | Default is FALSE - not closable} 23 | } 24 | \description{ 25 | Create Semantic UI Message box 26 | } 27 | \examples{ 28 | ## Only run examples in interactive R sessions 29 | if (interactive()){ 30 | library(shiny) 31 | library(shiny.semantic) 32 | 33 | ui <- shinyUI(semanticPage( 34 | message_box(header = "Main header", content = "text"), 35 | # message with icon 36 | message_box(class = "icon", header = "Main header", content = "text", icon_name = "dog"), 37 | # closable message 38 | message_box(header = "Main header", content = "text", closable = TRUE), 39 | # floating 40 | message_box(class = "floating", header = "Main header", content = "text"), 41 | # compact 42 | message_box(class = "compact", header = "Main header", content = "text"), 43 | # warning 44 | message_box(class = "warning", header = "Warning", content = "text"), 45 | # info 46 | message_box(class = "info", header = "Info", content = "text") 47 | )) 48 | server <- shinyServer(function(input, output) { 49 | }) 50 | 51 | shinyApp(ui, server) 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /man/multiple_checkbox.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/checkbox.R 3 | \name{multiple_checkbox} 4 | \alias{multiple_checkbox} 5 | \alias{multiple_radio} 6 | \title{Create Semantic UI multiple checkbox} 7 | \usage{ 8 | multiple_checkbox( 9 | input_id, 10 | label, 11 | choices, 12 | choices_value = choices, 13 | selected = NULL, 14 | position = "grouped", 15 | type = NULL, 16 | ... 17 | ) 18 | 19 | multiple_radio( 20 | input_id, 21 | label, 22 | choices, 23 | choices_value = choices, 24 | selected = choices_value[1], 25 | position = "grouped", 26 | type = "radio", 27 | ... 28 | ) 29 | } 30 | \arguments{ 31 | \item{input_id}{Input name. Reactive value is available under \code{input[[input_id]]}.} 32 | 33 | \item{label}{Text to be displayed with checkbox.} 34 | 35 | \item{choices}{Vector of labels to show checkboxes for.} 36 | 37 | \item{choices_value}{Vector of values that should be used for corresponding choice. 38 | If not specified, \code{choices} is used by default.} 39 | 40 | \item{selected}{The value(s) that should be chosen initially. 41 | If \code{NULL} the first one from \code{choices} is chosen.} 42 | 43 | \item{position}{Specified checkmarks setup. Can be \code{grouped} or \code{inline}.} 44 | 45 | \item{type}{Type of checkbox or radio.} 46 | 47 | \item{...}{Other arguments to be added as attributes of the 48 | tag (e.g. style, childrens etc.)} 49 | } 50 | \description{ 51 | This creates a multiple checkbox using Semantic UI styles. 52 | } 53 | \details{ 54 | The following \code{type}s are allowed: 55 | \itemize{ 56 | \item{NULL} The standard checkbox (default) 57 | \item{toggle} Each checkbox has a toggle form 58 | \item{slider} Each checkbox has a simple slider form 59 | } 60 | } 61 | \examples{ 62 | ## Only run examples in interactive R sessions 63 | if (interactive()) { 64 | # Checkbox 65 | library(shiny) 66 | library(shiny.semantic) 67 | 68 | ui <- function() { 69 | shinyUI( 70 | semanticPage( 71 | title = "Checkbox example", 72 | h1("Checkboxes"), 73 | multiple_checkbox("checkboxes", "Select Letters", LETTERS[1:6], selected = "A"), 74 | p("Selected letters:"), 75 | textOutput("selected_letters"), 76 | tags$br(), 77 | h1("Radioboxes"), 78 | multiple_radio("radioboxes", "Select Letter", LETTERS[1:6], selected = "A"), 79 | p("Selected letter:"), 80 | textOutput("selected_letter") 81 | ) 82 | ) 83 | } 84 | 85 | server <- shinyServer(function(input, output) { 86 | output$selected_letters <- renderText(paste(input$checkboxes, collapse = ", ")) 87 | output$selected_letter <- renderText(input$radioboxes) 88 | }) 89 | 90 | shinyApp(ui = ui(), server = server) 91 | } 92 | 93 | } 94 | -------------------------------------------------------------------------------- /man/numeric_input.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/input.R 3 | \name{numeric_input} 4 | \alias{numeric_input} 5 | \alias{numericInput} 6 | \title{Create Semantic UI Numeric Input} 7 | \usage{ 8 | numeric_input( 9 | input_id, 10 | label, 11 | value = NULL, 12 | min = NA, 13 | max = NA, 14 | step = NA, 15 | type = NULL, 16 | icon = NULL, 17 | placeholder = NULL, 18 | ... 19 | ) 20 | 21 | numericInput( 22 | inputId, 23 | label, 24 | value = NULL, 25 | min = NA, 26 | max = NA, 27 | step = NA, 28 | width = NULL, 29 | placeholder = NULL, 30 | ... 31 | ) 32 | } 33 | \arguments{ 34 | \item{input_id}{Input name. Reactive value is available under \code{input[[input_id]]}.} 35 | 36 | \item{label}{Display label for the control, or NULL for no label.} 37 | 38 | \item{value}{Initial value of the numeric input.} 39 | 40 | \item{min}{Minimum allowed value.} 41 | 42 | \item{max}{Maximum allowed value.} 43 | 44 | \item{step}{Interval to use when stepping between min and max.} 45 | 46 | \item{type}{Input type specifying class attached to input container. 47 | See [Fomantic UI](https://fomantic-ui.com/collections/form.html) for details.} 48 | 49 | \item{icon}{Icon or label attached to numeric input.} 50 | 51 | \item{placeholder}{Inner input label displayed when no value is specified} 52 | 53 | \item{...}{Other parameters passed to \code{\link{numeric_input}} like \code{type} or \code{icon}.} 54 | 55 | \item{inputId}{The input slot that will be used to access the value.} 56 | 57 | \item{width}{The width of the input.} 58 | } 59 | \description{ 60 | This creates a default numeric input using Semantic UI. The input is available 61 | under \code{input[[input_id]]}. 62 | } 63 | \details{ 64 | Either `value` or `placeholder` should be defined. 65 | The inputs are updateable by using \code{\link{updateNumericInput}}. 66 | } 67 | \examples{ 68 | ## Only run examples in interactive R sessions 69 | if (interactive()) { 70 | library(shiny) 71 | library(shiny.semantic) 72 | ui <- semanticPage( 73 | numeric_input("ex", "Select number", 10), 74 | ) 75 | server <- function(input, output, session) {} 76 | shinyApp(ui, server) 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /man/parse_val.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{parse_val} 4 | \alias{parse_val} 5 | \title{Parse the `shiny_input` value from JSON} 6 | \usage{ 7 | parse_val(val) 8 | } 9 | \arguments{ 10 | \item{val}{value to get from JSON} 11 | } 12 | \value{ 13 | Value of type defined in `shiny_input` 14 | } 15 | \description{ 16 | Parse the `shiny_input` value from JSON 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/progress.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/progress.R 3 | \name{progress} 4 | \alias{progress} 5 | \title{Create progress Semantic UI component} 6 | \usage{ 7 | progress( 8 | input_id, 9 | value = NULL, 10 | total = NULL, 11 | percent = NULL, 12 | progress_lab = FALSE, 13 | label = NULL, 14 | label_complete = NULL, 15 | size = "", 16 | class = NULL 17 | ) 18 | } 19 | \arguments{ 20 | \item{input_id}{Input name. Reactive value is available under input[[input_id]].} 21 | 22 | \item{value}{The initial value to be selected for the progress bar.} 23 | 24 | \item{total}{The maximum value that will be applied to the progress bar.} 25 | 26 | \item{percent}{The initial percentage to be selected for the progress bar.} 27 | 28 | \item{progress_lab}{Logical, would you like the percentage visible in the progress bar?} 29 | 30 | \item{label}{The label to be visible underneath the progress bar.} 31 | 32 | \item{label_complete}{The label to be visible underneath the progress bar when the bar is at 100\%.} 33 | 34 | \item{size}{character with legal semantic size, eg. "medium", "huge", "tiny"} 35 | 36 | \item{class}{UI class of the progress bar.} 37 | } 38 | \description{ 39 | This creates a default progress using Semantic UI styles with Shiny input. 40 | Progress is already initialized and available under input[[input_id]]. 41 | } 42 | \details{ 43 | To initialize the progress bar, you can either choose \code{value} and \code{total}, or \code{percent}. 44 | } 45 | \examples{ 46 | ## Only run examples in interactive R sessions 47 | if (interactive()) { 48 | 49 | library(shiny) 50 | library(shiny.semantic) 51 | ui <- function() { 52 | shinyUI( 53 | semanticPage( 54 | title = "Progress example", 55 | progress("progress", percent = 24, label = "{percent}\% complete"), 56 | p("Progress completion:"), 57 | textOutput("progress") 58 | ) 59 | ) 60 | } 61 | server <- shinyServer(function(input, output) { 62 | output$progress <- renderText(input$progress) 63 | }) 64 | 65 | shinyApp(ui = ui(), server = server) 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /man/rating_input.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rating.R 3 | \name{rating_input} 4 | \alias{rating_input} 5 | \title{Rating Input.} 6 | \usage{ 7 | rating_input( 8 | input_id, 9 | label = "", 10 | value = 0, 11 | max = 3, 12 | icon = "star", 13 | color = "yellow", 14 | size = "" 15 | ) 16 | } 17 | \arguments{ 18 | \item{input_id}{The \code{input} slot that will be used to access the value.} 19 | 20 | \item{label}{the contents of the item to display} 21 | 22 | \item{value}{initial rating value} 23 | 24 | \item{max}{maximum value} 25 | 26 | \item{icon}{character with name of the icon or \code{\link{icon}()} that is 27 | an element of the rating} 28 | 29 | \item{color}{character with colour name} 30 | 31 | \item{size}{character with legal semantic size, eg. "medium", "huge", "tiny"} 32 | } 33 | \value{ 34 | rating object 35 | } 36 | \description{ 37 | Crates rating component 38 | } 39 | \examples{ 40 | ## Only run examples in interactive R sessions 41 | if (interactive()) { 42 | library(shiny) 43 | library(shiny.semantic) 44 | 45 | ui <- shinyUI( 46 | semanticPage( 47 | rating_input("rate", "How do you like it?", max = 5, 48 | icon = "heart", color = "yellow"), 49 | ) 50 | ) 51 | server <- function(input, output) { 52 | observeEvent(input$rate,{print(input$rate)}) 53 | } 54 | shinyApp(ui = ui, server = server) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /man/register_search.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/semantic_search.R 3 | \name{register_search} 4 | \alias{register_search} 5 | \title{Register search api url} 6 | \usage{ 7 | register_search(session, data, search_query) 8 | } 9 | \arguments{ 10 | \item{session}{Shiny server session} 11 | 12 | \item{data}{Data (the value that is passed into registerDataObj)} 13 | 14 | \item{search_query}{Function providing a response as a list of 15 | lists or dataframe of search results.} 16 | } 17 | \description{ 18 | Calls Shiny session's registerDataObj to create REST API. 19 | Publishes any R object as a URL endpoint that is unique to Shiny session. 20 | search_query must be a function that takes two arguments: 21 | data (the value that was passed into registerDataObj) and req 22 | (an environment that implements the Rook specification for HTTP requests). 23 | search_query will be called with these values whenever an HTTP request is 24 | made to the URL endpoint. The return value of search_query should be a list 25 | of list or a dataframe. Note that different semantic components expect 26 | specific JSON fields to be present in order to work correctly. 27 | Check components documentation for details. 28 | } 29 | \examples{ 30 | if (interactive()) { 31 | library(shiny) 32 | library(tibble) 33 | library(shiny.semantic) 34 | shinyApp( 35 | ui = semanticPage( 36 | textInput("txt", "Enter the car name (or subset of name)"), 37 | textOutput("api_url"), 38 | uiOutput("open_url") 39 | ), 40 | server = function(input, output, session) { 41 | api_response <- function(data, q) { 42 | has_matching <- function(field) { 43 | grepl(toupper(q), toupper(field), fixed = TRUE) 44 | } 45 | dplyr::filter(data, has_matching(car)) 46 | } 47 | 48 | search_api_url <- register_search(session, 49 | tibble::rownames_to_column(mtcars, "car"), api_response) 50 | 51 | output$api_url <- renderText({ 52 | glue::glue( 53 | "Registered API url: ", 54 | "{session$clientData$url_protocol}//{session$clientData$url_hostname}", 55 | ":{session$clientData$url_port}/", 56 | "{search_api_url}&q={input$txt}" 57 | ) 58 | }) 59 | 60 | output$open_url <- renderUI({ 61 | tags$a( 62 | "Open", class = "ui button", 63 | href = glue::glue("./{search_api_url}&q={input$txt}"), target = "_blank" 64 | ) 65 | }) 66 | } 67 | ) 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /man/render_menu_link.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/menu.R 3 | \name{render_menu_link} 4 | \alias{render_menu_link} 5 | \title{Render menu link} 6 | \usage{ 7 | render_menu_link(location, title, active_location = "", icon = NULL) 8 | } 9 | \arguments{ 10 | \item{location}{character url with location} 11 | 12 | \item{title}{name of the page} 13 | 14 | \item{active_location}{name of the active subpage (if matches location then 15 | it gets highlighted), default empty (\code{""})} 16 | 17 | \item{icon}{non-mandatory parameter with icon name} 18 | } 19 | \value{ 20 | shiny tag link 21 | } 22 | \description{ 23 | This function renders horizontal menu item. 24 | } 25 | \examples{ 26 | render_menu_link("#subpage1", "SUBPAGE") 27 | } 28 | \seealso{ 29 | horizontal_menu 30 | } 31 | -------------------------------------------------------------------------------- /man/search_field.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/search_field.R 3 | \name{search_field} 4 | \alias{search_field} 5 | \title{Create search field Semantic UI component} 6 | \usage{ 7 | search_field(input_id, search_api_url, default_text = "Search", value = "") 8 | } 9 | \arguments{ 10 | \item{input_id}{Input name. Reactive value is available under input[[input_id]].} 11 | 12 | \item{search_api_url}{Register custom API url with server JSON Response 13 | containing fields `title` and `description`.} 14 | 15 | \item{default_text}{Text to be visible on serach field when nothing 16 | is selected.} 17 | 18 | \item{value}{Pass value if you want to initialize selection for search field.} 19 | } 20 | \description{ 21 | This creates a default search field using Semantic UI styles with Shiny 22 | input. Search field is already initialized and available under input[[input_id]]. 23 | Search will automatically route to the named API endpoint provided 24 | as parameter. API response is expected to be a JSON with property fields 25 | `title` and `description`. 26 | See https://semantic-ui.com/modules/search.html#behaviors for more details. 27 | } 28 | \examples{ 29 | ## Only run examples in interactive R sessions 30 | \dontrun{ 31 | if (interactive()) { 32 | library(shiny) 33 | library(shiny.semantic) 34 | library(gapminder) 35 | library(dplyr) 36 | 37 | ui <- function() { 38 | shinyUI( 39 | semanticPage( 40 | title = "Dropdown example", 41 | p("Search country:"), 42 | uiOutput("search_country"), 43 | p("Selected country:"), 44 | textOutput("selected_country") 45 | ) 46 | ) 47 | } 48 | 49 | server <- shinyServer(function(input, output, session) { 50 | 51 | search_api <- function(gapminder, q) { 52 | has_matching <- function(field) { 53 | startsWith(field, q) 54 | } 55 | gapminder \%>\% 56 | mutate(country = as.character(country)) \%>\% 57 | select(country) \%>\% 58 | unique \%>\% 59 | filter(has_matching(country)) \%>\% 60 | head(5) \%>\% 61 | transmute(title = country, 62 | description = country) 63 | } 64 | 65 | search_api_url <- register_search(session, gapminder, search_api) 66 | output$search_letters <- shiny::renderUI( 67 | search_field("search_result", search_api_url) 68 | ) 69 | output$selected_country <- renderText(input[["search_result"]]) 70 | }) 71 | } 72 | 73 | shinyApp(ui = ui(), server = server) 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /man/search_selection_api.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/semantic_search.R 3 | \name{search_selection_api} 4 | \alias{search_selection_api} 5 | \title{Add Semantic UI search selection dropdown based on REST API} 6 | \usage{ 7 | search_selection_api( 8 | input_id, 9 | search_api_url, 10 | multiple = FALSE, 11 | default_text = "Select" 12 | ) 13 | } 14 | \arguments{ 15 | \item{input_id}{Input name. Reactive value is available under input[[input_id]].} 16 | 17 | \item{search_api_url}{Register API url with server JSON Response containing 18 | fields `name` and `value`.} 19 | 20 | \item{multiple}{TRUE if the dropdown should allow multiple selections, 21 | FALSE otherwise (default FALSE).} 22 | 23 | \item{default_text}{Text to be visible on dropdown when nothing is selected.} 24 | } 25 | \description{ 26 | Define the (multiple) search selection dropdown input for retrieving remote 27 | selection menu content from an API endpoint. API response is expected to be 28 | a JSON with property fields `name` and `value`. Using a search selection 29 | dropdown allows to search more easily through large lists. 30 | } 31 | \examples{ 32 | ## Only run examples in interactive R sessions 33 | if (interactive()) { 34 | library(shiny) 35 | library(shiny.semantic) 36 | library(gapminder) 37 | library(dplyr) 38 | 39 | ui <- function() { 40 | shinyUI( 41 | semanticPage( 42 | title = "Dropdown example", 43 | uiOutput("search_letters"), 44 | p("Selected letter:"), 45 | textOutput("selected_letters") 46 | ) 47 | ) 48 | } 49 | 50 | server <- shinyServer(function(input, output, session) { 51 | 52 | search_api <- function(gapminder, q) { 53 | has_matching <- function(field) { 54 | startsWith(field, q) 55 | } 56 | gapminder \%>\% 57 | mutate(country = as.character(country)) \%>\% 58 | select(country) \%>\% 59 | unique \%>\% 60 | filter(has_matching(country)) \%>\% 61 | head(5) \%>\% 62 | transmute(name = country, 63 | value = country) 64 | } 65 | 66 | search_api_url <- shiny.semantic::register_search(session, 67 | gapminder, 68 | search_api) 69 | output$search_letters <- shiny::renderUI( 70 | search_selection_api("search_result", search_api_url, multiple = TRUE) 71 | ) 72 | output$selected_letters <- renderText(input[["search_result"]]) 73 | }) 74 | 75 | shinyApp(ui = ui(), server = server) 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /man/search_selection_choices.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/semantic_search.R 3 | \name{search_selection_choices} 4 | \alias{search_selection_choices} 5 | \title{Add Semantic UI search selection dropdown based on provided choices} 6 | \usage{ 7 | search_selection_choices( 8 | input_id, 9 | choices, 10 | value = NULL, 11 | multiple = FALSE, 12 | default_text = "Select", 13 | groups = NULL, 14 | dropdown_settings = list(forceSelection = FALSE) 15 | ) 16 | } 17 | \arguments{ 18 | \item{input_id}{Input name. Reactive value is available under input[[input_id]].} 19 | 20 | \item{choices}{Vector or a list of choices to search through.} 21 | 22 | \item{value}{String with default values to set when initialize the component. 23 | Values should be delimited with a comma when multiple to set. Default NULL.} 24 | 25 | \item{multiple}{TRUE if the dropdown should allow multiple selections, 26 | FALSE otherwise (default FALSE).} 27 | 28 | \item{default_text}{Text to be visible on dropdown when nothing is selected.} 29 | 30 | \item{groups}{Vector of length equal to choices, specifying to which group the choice belongs. 31 | Specifying the parameter enables group dropdown search implementation.} 32 | 33 | \item{dropdown_settings}{Settings passed to dropdown() semantic-ui method. 34 | See https://semantic-ui.com/modules/dropdown.html#/settings} 35 | } 36 | \description{ 37 | Define the (multiple) search selection dropdown input component serving 38 | search options using provided choices. 39 | } 40 | \examples{ 41 | ## Only run examples in interactive R sessions 42 | if (interactive()) { 43 | library(shiny) 44 | library(shiny.semantic) 45 | 46 | ui <- function() { 47 | shinyUI( 48 | semanticPage( 49 | title = "Dropdown example", 50 | uiOutput("search_letters"), 51 | p("Selected letter:"), 52 | textOutput("selected_letters") 53 | ) 54 | ) 55 | } 56 | 57 | server <- shinyServer(function(input, output, session) { 58 | choices <- LETTERS 59 | output$search_letters <- shiny::renderUI( 60 | search_selection_choices("search_result", choices, multiple = TRUE) 61 | ) 62 | output$selected_letters <- renderText(input[["search_result"]]) 63 | }) 64 | 65 | shinyApp(ui = ui(), server = server) 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /man/segment.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{segment} 4 | \alias{segment} 5 | \title{Create Semantic UI segment} 6 | \usage{ 7 | segment(..., class = "") 8 | } 9 | \arguments{ 10 | \item{...}{Other arguments to be added as attributes of the 11 | tag (e.g. style, class or childrens etc.)} 12 | 13 | \item{class}{Additional classes to add to html tag.} 14 | } 15 | \description{ 16 | This creates a segment using Semantic UI styles. 17 | } 18 | \examples{ 19 | ## Only run examples in interactive R sessions 20 | if (interactive()){ 21 | library(shiny) 22 | library(shiny.semantic) 23 | 24 | ui <- shinyUI(semanticPage( 25 | segment(), 26 | # placeholder 27 | segment(class = "placeholder segment"), 28 | # raised 29 | segment(class = "raised segment"), 30 | # stacked 31 | segment(class = "stacked segment"), 32 | # piled 33 | segment(class = "piled segment") 34 | )) 35 | server <- shinyServer(function(input, output) { 36 | }) 37 | 38 | shinyApp(ui, server) 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /man/selectInput.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dropdown.R 3 | \name{selectInput} 4 | \alias{selectInput} 5 | \title{Create a select list input control} 6 | \usage{ 7 | selectInput( 8 | inputId, 9 | label, 10 | choices, 11 | selected = NULL, 12 | multiple = FALSE, 13 | width = NULL, 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{inputId}{The input slot that will be used to access the value.} 19 | 20 | \item{label}{Display label for the control, or NULL for no label.} 21 | 22 | \item{choices}{List of values to select from. If elements of the list are named, 23 | then that name — rather than the value — is displayed to the user.} 24 | 25 | \item{selected}{The initially selected value (or multiple values if multiple = TRUE). 26 | If not specified then defaults to the first value for single-select lists and no 27 | values for multiple select lists.} 28 | 29 | \item{multiple}{Is selection of multiple items allowed?} 30 | 31 | \item{width}{The width of the input.} 32 | 33 | \item{...}{Arguments passed to \link{dropdown_input}.} 34 | } 35 | \description{ 36 | Create a select list that can be used to choose a single or multiple items from a list of values. 37 | } 38 | \examples{ 39 | ## Only run examples in interactive R sessions 40 | if (interactive()) { 41 | 42 | library(shiny.semantic) 43 | 44 | # basic example 45 | shinyApp( 46 | ui = semanticPage( 47 | selectInput("variable", "Variable:", 48 | c("Cylinders" = "cyl", 49 | "Transmission" = "am", 50 | "Gears" = "gear")), 51 | tableOutput("data") 52 | ), 53 | server = function(input, output) { 54 | output$data <- renderTable({ 55 | mtcars[, c("mpg", input$variable), drop = FALSE] 56 | }, rownames = TRUE) 57 | } 58 | ) 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /man/semanticPage.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/semanticPage.R 3 | \name{semanticPage} 4 | \alias{semanticPage} 5 | \title{Semantic UI page} 6 | \usage{ 7 | semanticPage( 8 | ..., 9 | title = "", 10 | theme = NULL, 11 | suppress_bootstrap = TRUE, 12 | margin = "10px" 13 | ) 14 | } 15 | \arguments{ 16 | \item{...}{Other arguments to be added as attributes of the main div tag 17 | wrapper (e.g. style, class etc.)} 18 | 19 | \item{title}{A title to display in the browser's title bar.} 20 | 21 | \item{theme}{Theme name or path. Full list of supported themes you will find in 22 | \code{\link[semantic.assets:SUPPORTED_THEMES]{semantic.assets::SUPPORTED_THEMES}} 23 | or at http://semantic-ui-forest.com/themes.} 24 | 25 | \item{suppress_bootstrap}{boolean flag that supresses bootstrap when turned on} 26 | 27 | \item{margin}{character with body margin size} 28 | } 29 | \description{ 30 | This creates a Semantic page for use in a Shiny app. 31 | } 32 | \details{ 33 | Inside, it uses two crucial options: 34 | 35 | (1) \code{shiny.minified} with a logical value, tells whether it should attach min or full 36 | semnatic css or js (TRUE by default). 37 | (2) \code{shiny.custom.semantic} if this option has not NULL character \code{semanticPage} 38 | takes dependencies from custom css and js files specified in this path 39 | (NULL by default). Depending on \code{shiny.minified} value the folder should contain 40 | either "min" or standard version. The folder should contain: \code{semantic.css} and 41 | \code{semantic.js} files, or \code{semantic.min.css} and \code{semantic.min.js} 42 | in \code{shiny.minified = TRUE} mode. 43 | } 44 | \examples{ 45 | ## Only run examples in interactive R sessions 46 | if (interactive()) { 47 | library(shiny) 48 | library(shiny.semantic) 49 | 50 | ui <- semanticPage( 51 | title = "Hello Shiny Semantic!", 52 | tags$label("Number of observations:"), 53 | slider_input("obs", value = 500, min = 0, max = 1000), 54 | segment( 55 | plotOutput("dist_plot") 56 | ) 57 | ) 58 | 59 | server <- function(input, output) { 60 | output$dist_plot <- renderPlot({ 61 | hist(rnorm(input$obs)) 62 | }) 63 | } 64 | 65 | shinyApp(ui, server) 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /man/semantic_DT.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tables.R 3 | \name{semantic_DT} 4 | \alias{semantic_DT} 5 | \title{Create Semantic DT Table} 6 | \usage{ 7 | semantic_DT( 8 | ..., 9 | options = list(), 10 | style = "semanticui", 11 | class = "ui small compact table" 12 | ) 13 | } 14 | \arguments{ 15 | \item{...}{datatable parameters, check \code{?DT::datatable} to learn more.} 16 | 17 | \item{options}{datatable options, check \code{?DT::datatable} to learn more.} 18 | 19 | \item{style}{datatable style, check \code{?DT::datatable} to learn more.} 20 | 21 | \item{class}{datatable class, check \code{?DT::datatable} to learn more.} 22 | } 23 | \description{ 24 | This creates DT table styled with Semantic UI. 25 | } 26 | \examples{ 27 | if (interactive()){ 28 | library(shiny) 29 | library(shiny.semantic) 30 | 31 | ui <- semanticPage( 32 | semantic_DTOutput("table") 33 | ) 34 | server <- function(input, output, session) { 35 | output$table <- DT::renderDataTable( 36 | semantic_DT(iris) 37 | ) 38 | } 39 | shinyApp(ui, server) 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /man/semantic_DTOutput.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tables.R 3 | \name{semantic_DTOutput} 4 | \alias{semantic_DTOutput} 5 | \title{Semantic DT Output} 6 | \usage{ 7 | semantic_DTOutput(...) 8 | } 9 | \arguments{ 10 | \item{...}{datatable parameters, check \code{?DT::datatable} to learn more.} 11 | } 12 | \value{ 13 | DT Output with semanitc style 14 | } 15 | \description{ 16 | Semantic DT Output 17 | } 18 | -------------------------------------------------------------------------------- /man/set_tab_id.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{set_tab_id} 4 | \alias{set_tab_id} 5 | \title{Sets tab id if not provided} 6 | \usage{ 7 | set_tab_id(tab) 8 | } 9 | \arguments{ 10 | \item{tab}{A tab. Tab is a list of three elements - first 11 | element defines menu item, second element defines tab content, third optional element defines tab id.} 12 | } 13 | \description{ 14 | Sets tab id if it wasn't provided 15 | } 16 | \keyword{internal} 17 | -------------------------------------------------------------------------------- /man/shiny.semantic-package.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/shiny.semantic-package.R 3 | \docType{package} 4 | \name{shiny.semantic-package} 5 | \alias{shiny.semantic} 6 | \alias{shiny.semantic-package} 7 | \title{Semantic UI wrapper for Shiny} 8 | \description{ 9 | With this library it’s easy to wrap Shiny with Semantic UI 10 | components. Add a few simple lines of code and some CSS classes to give 11 | your UI a fresh, modern and highly interactive look. 12 | } 13 | \section{Options}{ 14 | 15 | There are a number of global options that affect shiny.semantic as well as 16 | Shiny behavior.The options can be set globally with `options()` 17 | \describe{ 18 | \item{shiny.custom.semantic.cdn (defaults to `NULL`)}{This controls from where the css 19 | and javascripts will be downloaded.} 20 | \item{shiny.custom.semantic (defaults to `NULL`)}{This allows to set custom local path 21 | to semantic dependencies.} 22 | \item{shiny.minified (defaults to `TRUE`)}{Defines including JavaScript as a minified or 23 | un-minified file.} 24 | } 25 | } 26 | 27 | \seealso{ 28 | Useful links: 29 | \itemize{ 30 | \item \url{https://appsilon.github.io/shiny.semantic/} 31 | \item \url{https://github.com/Appsilon/shiny.semantic} 32 | \item Report bugs at \url{https://github.com/Appsilon/shiny.semantic/issues} 33 | } 34 | 35 | } 36 | \author{ 37 | \strong{Maintainer}: Jakub Nowicki \email{opensource+kuba@appsilon.com} 38 | 39 | Authors: 40 | \itemize{ 41 | \item Filip Stachura \email{filip@appsilon.com} 42 | \item Dominik Krzeminski 43 | \item Krystian Igras 44 | \item Adam Forys 45 | \item Paweł Przytuła \email{pawel@appsilon.com} 46 | \item Jakub Chojna \email{jakub.chojna@appsilon.com} 47 | \item Olga Mierzwa-Sulima \email{olga@appsilon.com} 48 | \item Tymoteusz Makowski \email{tymoteusz.makowski@appsilon.com} 49 | } 50 | 51 | Other contributors: 52 | \itemize{ 53 | \item Ashley Baldry [contributor] 54 | \item Pedro Manuel Coutinho da Silva \email{pedro@appsilon.com} [contributor] 55 | \item Kamil Żyła \email{kamil@appsilon.com} [contributor] 56 | \item Rabii Bouhestine [contributor] 57 | \item Federico Rivandeira \email{federico@appsilon.com} [contributor] 58 | \item Appsilon Sp. z o.o. [copyright holder] 59 | } 60 | 61 | } 62 | \keyword{internal} 63 | -------------------------------------------------------------------------------- /man/shiny_input.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/shiny.R 3 | \name{shiny_input} 4 | \alias{shiny_input} 5 | \title{Create universal Shiny input binding} 6 | \usage{ 7 | shiny_input(input_id, shiny_ui, value = NULL, type = "JSON") 8 | } 9 | \arguments{ 10 | \item{input_id}{String with name of this input. Access to this input within server code is normal with 11 | input[[input_id]].} 12 | 13 | \item{shiny_ui}{UI of HTML component presenting this input to the users. This UI should allow to extract its value 14 | with jQuery $().val() function.} 15 | 16 | \item{value}{An optional argument with value that should be set for this input. Can be used to store persisten input 17 | valus in dynamic UIs.} 18 | 19 | \item{type}{Type of input value (could be "JSON" or "text").} 20 | } 21 | \description{ 22 | Universal binding for Shiny input on custom user interface. Using this function one can create various inputs 23 | ranging from text, numerical, date, dropdowns, etc. Value of this input is extracted via jQuery using $().val() 24 | function and default exposed as serialized JSON to the Shiny server. If you want to change type of exposed input 25 | value specify it via type param. Currently list of supported types is "JSON" (default) and "text". 26 | } 27 | \examples{ 28 | library(shiny) 29 | library(shiny.semantic) 30 | # Create a week field 31 | uirender( 32 | tagList( 33 | div(class = "ui icon input", 34 | style = NULL, 35 | "", 36 | shiny_input( 37 | "my_id", 38 | tags$input(type = "week", name = "my_id", min = NULL, max = NULL), 39 | value = NULL, 40 | type = "text"), 41 | icon("calendar")) 42 | ) 43 | ) 44 | 45 | } 46 | -------------------------------------------------------------------------------- /man/shiny_text_input.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/shiny.R 3 | \name{shiny_text_input} 4 | \alias{shiny_text_input} 5 | \title{Create universal Shiny text input binding} 6 | \usage{ 7 | shiny_text_input(...) 8 | } 9 | \arguments{ 10 | \item{...}{Possible arguments are the same as in shiny_input() method: 11 | input_id, shiny_ui, value. Type is already predefined as "text"} 12 | } 13 | \description{ 14 | Universal binding for Shiny text input on custom user interface. Value of 15 | this input is extracted via jQuery using $().val() function. This function 16 | is just a simple binding over shiny_input. Please take a look at shiny_input 17 | documentation for more information. 18 | } 19 | \examples{ 20 | library(shiny) 21 | library(shiny.semantic) 22 | # Create a color picker 23 | uirender( 24 | tagList( 25 | div(class = "ui input", 26 | style = NULL, 27 | "Color picker", 28 | shiny_text_input( 29 | "my_id", 30 | tags$input(type = "color", name = "my_id", value = "#ff0000")) 31 | ) 32 | )) 33 | 34 | } 35 | -------------------------------------------------------------------------------- /man/show_modal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modal.R 3 | \name{show_modal} 4 | \alias{show_modal} 5 | \alias{remove_modal} 6 | \alias{remove_all_modals} 7 | \alias{removeModal} 8 | \alias{hide_modal} 9 | \title{Show, Hide or Remove Semantic UI modal} 10 | \usage{ 11 | show_modal(id, session = shiny::getDefaultReactiveDomain(), asis = TRUE) 12 | 13 | remove_modal(id, session = shiny::getDefaultReactiveDomain(), asis = TRUE) 14 | 15 | remove_all_modals(session = shiny::getDefaultReactiveDomain()) 16 | 17 | removeModal(session = shiny::getDefaultReactiveDomain()) 18 | 19 | hide_modal(id, session = shiny::getDefaultReactiveDomain(), asis = TRUE) 20 | } 21 | \arguments{ 22 | \item{id}{ID of the modal that will be displayed.} 23 | 24 | \item{session}{The \code{session} object passed to function given to 25 | \code{shinyServer}.} 26 | 27 | \item{asis}{A boolean indicating if the id must be handled as is (TRUE) or 28 | FALSE if it meants to be namespaced} 29 | } 30 | \description{ 31 | This displays a hidden Semantic UI modal. 32 | } 33 | \seealso{ 34 | modal 35 | } 36 | -------------------------------------------------------------------------------- /man/single_step.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/step.R 3 | \name{single_step} 4 | \alias{single_step} 5 | \title{Creates a single step to be used inside of a list of steps by the steps 6 | function} 7 | \usage{ 8 | single_step( 9 | id, 10 | title, 11 | description = NULL, 12 | icon_class = NULL, 13 | step_class = NULL 14 | ) 15 | } 16 | \arguments{ 17 | \item{id}{The \code{input} slot that will be used to access the value.} 18 | 19 | \item{title}{A character that will be the title of the ste} 20 | 21 | \item{description}{A character that will fill the description of the step} 22 | 23 | \item{icon_class}{A character which will be correpond to a fomantic icon 24 | class to be used in the step} 25 | 26 | \item{step_class}{A character representing a class to be passed to the step} 27 | } 28 | \description{ 29 | Creates a single step to be used inside of a list of steps by the steps 30 | function 31 | } 32 | \seealso{ 33 | steps 34 | } 35 | -------------------------------------------------------------------------------- /man/split_args.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{split_args} 4 | \alias{split_args} 5 | \title{Split arguments to positional and named} 6 | \usage{ 7 | split_args(...) 8 | } 9 | \arguments{ 10 | \item{...}{arguments to split} 11 | } 12 | \value{ 13 | A list with two named elements: 14 | \itemize{ 15 | \item \code{positional}, a list of the positional arguments, 16 | \item \code{named}, a list of the named arguments. 17 | } 18 | } 19 | \description{ 20 | Split arguments to positional and named 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/split_layout.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/layouts.R 3 | \name{split_layout} 4 | \alias{split_layout} 5 | \alias{splitLayout} 6 | \title{Split layout} 7 | \usage{ 8 | split_layout(..., cell_widths = NULL, cell_args = "", style = NULL) 9 | 10 | splitLayout(..., cellWidths = NULL, cellArgs = "", style = NULL) 11 | } 12 | \arguments{ 13 | \item{...}{Unnamed arguments will become child elements of the layout.} 14 | 15 | \item{cell_widths}{Character or numeric vector indicating the widths of the 16 | individual cells. Recycling will be used if needed.} 17 | 18 | \item{cell_args}{character with additional attributes that should be used for 19 | each cell of the layout.} 20 | 21 | \item{style}{character with style of outer box surrounding all elements} 22 | 23 | \item{cellWidths}{same as \code{cell_widths}} 24 | 25 | \item{cellArgs}{same as \code{cell_args}} 26 | } 27 | \value{ 28 | split layout grid object 29 | } 30 | \description{ 31 | Lays out elements horizontally, dividing the available horizontal space into 32 | equal parts (by default) or specified by parameters. 33 | } 34 | \examples{ 35 | if (interactive()) { 36 | #' Server code used for all examples 37 | server <- function(input, output) { 38 | output$plot1 <- renderPlot(plot(cars)) 39 | output$plot2 <- renderPlot(plot(pressure)) 40 | output$plot3 <- renderPlot(plot(AirPassengers)) 41 | } 42 | #' Equal sizing 43 | ui <- semanticPage( 44 | split_layout( 45 | plotOutput("plot1"), 46 | plotOutput("plot2") 47 | ) 48 | ) 49 | shinyApp(ui, server) 50 | #' Custom widths 51 | ui <- semanticPage( 52 | split_layout(cell_widths = c("25\%", "75\%"), 53 | plotOutput("plot1"), 54 | plotOutput("plot2") 55 | ) 56 | ) 57 | shinyApp(ui, server) 58 | #' All cells at 300 pixels wide, with cell padding 59 | #' and a border around everything 60 | ui <- semanticPage( 61 | split_layout( 62 | cell_widths = 300, 63 | cell_args = "padding: 6px;", 64 | style = "border: 1px solid silver;", 65 | plotOutput("plot1"), 66 | plotOutput("plot2"), 67 | plotOutput("plot3") 68 | ) 69 | ) 70 | shinyApp(ui, server) 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /man/steps.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/step.R 3 | \name{steps} 4 | \alias{steps} 5 | \title{Show steps} 6 | \usage{ 7 | steps(id, steps_list, class = NULL) 8 | } 9 | \arguments{ 10 | \item{id}{ID of the Steps that will be displayed.} 11 | 12 | \item{steps_list}{A list of steps generated by single_steps.} 13 | 14 | \item{class}{(Optional) A character string with the semantic class to be 15 | added to the steps element.} 16 | } 17 | \description{ 18 | Show steps 19 | } 20 | \examples{ 21 | if (interactive()) { 22 | library(shiny) 23 | library(shiny.semantic) 24 | ui <- semanticPage( 25 | title = "Steps Example", 26 | shiny::tagList( 27 | h2("Steps example"), 28 | shiny.semantic::steps( 29 | id = "steps", 30 | steps_list = list( 31 | single_step( 32 | id = "step_1", 33 | title = "Step 1", 34 | description = "It's night?", 35 | icon_class = "moon" 36 | ), 37 | single_step( 38 | id = "step_2", 39 | title = "Step 2", 40 | description = "Order some food", 41 | icon_class = "bug" 42 | ), 43 | single_step(id = "step_3", 44 | title = "Step 3", 45 | description = "Feed the Kiwi", 46 | icon_class = "kiwi bird" 47 | ) 48 | ) 49 | ), 50 | h3("Actions"), 51 | shiny.semantic::action_button("step_1_complete", "Make it night"), 52 | shiny.semantic::action_button("step_2_complete", "Call the insects"), 53 | shiny.semantic::action_button("step_3_complete", "Feed the Kiwi"), 54 | shiny.semantic::action_button("hungry_kiwi", "Kiwi is hungry again"), 55 | ) 56 | ) 57 | 58 | server <- function(input, output, session) { 59 | observeEvent(input$step_1_complete, { 60 | toggle_step_state("step_1") 61 | }) 62 | 63 | observeEvent(input$step_2_complete, { 64 | toggle_step_state("step_2") 65 | }) 66 | 67 | observeEvent(input$step_3_complete, { 68 | toggle_step_state("step_3") 69 | }) 70 | 71 | observeEvent(input$hungry_kiwi, { 72 | toggle_step_state("step_1", FALSE) 73 | toggle_step_state("step_2", FALSE) 74 | toggle_step_state("step_3", FALSE) 75 | }) 76 | 77 | } 78 | 79 | shiny::shinyApp(ui, server) 80 | } 81 | } 82 | \seealso{ 83 | single_steps 84 | } 85 | -------------------------------------------------------------------------------- /man/tabset.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{tabset} 4 | \alias{tabset} 5 | \title{Create Semantic UI tabs} 6 | \usage{ 7 | tabset( 8 | tabs, 9 | active = NULL, 10 | id = generate_random_id("menu"), 11 | menu_class = "top attached tabular", 12 | tab_content_class = "bottom attached grid segment" 13 | ) 14 | } 15 | \arguments{ 16 | \item{tabs}{A list of tabs. Each tab is a list of three elements - first 17 | element defines menu item, second element defines tab content, third optional element defines tab id.} 18 | 19 | \item{active}{Id of the active tab. If NULL first tab will be active.} 20 | 21 | \item{id}{Id of the menu element (default: randomly generated id)} 22 | 23 | \item{menu_class}{Class for the menu element (default: "top attached 24 | tabular")} 25 | 26 | \item{tab_content_class}{Class for the tab content (default: "bottom attached 27 | segment")} 28 | } 29 | \description{ 30 | This creates tabs with content using Semantic UI styles. 31 | } 32 | \details{ 33 | You may access active tab id with \code{input$}. 34 | } 35 | \examples{ 36 | ## Only run examples in interactive R sessions 37 | if (interactive()){ 38 | library(shiny) 39 | library(shiny.semantic) 40 | 41 | ui <- semanticPage( 42 | tabset(tabs = 43 | list( 44 | list(menu = "First Tab", content = "Tab 1"), 45 | list(menu = "Second Tab", content = "Tab 2", id = "second_tab") 46 | ), 47 | active = "second_tab", 48 | id = "exampletabset" 49 | ), 50 | h2("Active Tab:"), 51 | textOutput("activetab") 52 | ) 53 | server <- function(input, output) { 54 | output$activetab <- renderText(input$exampletabset) 55 | } 56 | shinyApp(ui, server) 57 | } 58 | 59 | } 60 | \seealso{ 61 | update_tabset 62 | } 63 | -------------------------------------------------------------------------------- /man/textAreaInput.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/input.R 3 | \name{textAreaInput} 4 | \alias{textAreaInput} 5 | \title{Create a semantic Text Area input} 6 | \usage{ 7 | textAreaInput(inputId, label, value = "", width = NULL, placeholder = NULL) 8 | } 9 | \arguments{ 10 | \item{inputId}{Input name. Reactive value is available under \code{input[[input_id]]}.} 11 | 12 | \item{label}{character with label put above the input} 13 | 14 | \item{value}{Pass value if you want to have default text.} 15 | 16 | \item{width}{The width of the input, eg. "40px"} 17 | 18 | \item{placeholder}{Text visible in the input when nothing is inputted.} 19 | } 20 | \description{ 21 | Create a text area input control for entry of unstructured text values. 22 | } 23 | \examples{ 24 | ## Only run examples in interactive R sessions 25 | if (interactive()) { 26 | ui <- semanticPage( 27 | textAreaInput("a", "Area:", value = "200", width = "200px"), 28 | verbatimTextOutput("value") 29 | ) 30 | server <- function(input, output, session) { 31 | output$value <- renderText({ input$a }) 32 | } 33 | shinyApp(ui, server) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /man/text_input.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/input.R 3 | \name{text_input} 4 | \alias{text_input} 5 | \alias{textInput} 6 | \title{Create Semantic UI Text Input} 7 | \usage{ 8 | text_input( 9 | input_id, 10 | label = NULL, 11 | value = "", 12 | type = "text", 13 | placeholder = NULL, 14 | attribs = list() 15 | ) 16 | 17 | textInput( 18 | inputId, 19 | label, 20 | value = "", 21 | width = NULL, 22 | placeholder = NULL, 23 | type = "text" 24 | ) 25 | } 26 | \arguments{ 27 | \item{input_id}{Input name. Reactive value is available under \code{input[[input_id]]}.} 28 | 29 | \item{label}{character with label put on the left from the input} 30 | 31 | \item{value}{Pass value if you want to have default text.} 32 | 33 | \item{type}{Change depending what type of input is wanted. See details for options.} 34 | 35 | \item{placeholder}{Text visible in the input when nothing is inputted.} 36 | 37 | \item{attribs}{A named list of attributes to assign to the input.} 38 | 39 | \item{inputId}{Input name. The same as \code{input_id}.} 40 | 41 | \item{width}{The width of the input, eg. "40px"} 42 | } 43 | \description{ 44 | This creates a default text input using Semantic UI. The input is available 45 | under \code{input[[input_id]]}. 46 | } 47 | \details{ 48 | The following \code{type} s are allowed: 49 | \itemize{ 50 | \item{text} The standard input 51 | \item{textarea} An extended space for text 52 | \item{password} A censored version of the text input 53 | \item{email} A special version of the text input specific for email addresses 54 | \item{url} A special version of the text input specific for URLs 55 | \item{tel} A special version of the text input specific for telephone numbers 56 | } 57 | 58 | The inputs are updateable by using \code{\link[shiny]{updateTextInput}} or 59 | \code{\link[shiny]{updateTextAreaInput}} if \code{type = "textarea"}. 60 | } 61 | \examples{ 62 | ## Only run examples in interactive R sessions 63 | if (interactive()) { 64 | library(shiny) 65 | library(shiny.semantic) 66 | ui <- semanticPage( 67 | uiinput( 68 | text_input("ex", label = "Your text", type = "text", placeholder = "Enter Text") 69 | ) 70 | ) 71 | server <- function(input, output, session) { 72 | } 73 | shinyApp(ui, server) 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /man/theme_selector.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dropdown.R 3 | \name{theme_selector} 4 | \alias{theme_selector} 5 | \title{Themes changer dropdown} 6 | \usage{ 7 | theme_selector(input_id = "theme", label = "Choose theme") 8 | } 9 | \arguments{ 10 | \item{input_id}{Id of dropdown. \code{input[[input_id]]} returns the currently selected theme.} 11 | 12 | \item{label}{Dropdown label.} 13 | } 14 | \description{ 15 | Themes changer dropdown 16 | } 17 | \examples{ 18 | 19 | if (interactive()) { 20 | library(shiny) 21 | library(shiny.semantic) 22 | ui <- semanticPage( 23 | theme = "superhero", 24 | actionButton("action_button", "Press Me!"), 25 | textOutput("button_output"), 26 | theme_selector(), 27 | textOutput("theme") 28 | ) 29 | server <- function(input, output, session) { 30 | output$button_output <- renderText(as.character(input$action_button)) 31 | output$theme <- renderText(as.character(input$theme)) 32 | } 33 | shinyApp(ui, server) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /man/toggle_step_state.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/step.R 3 | \name{toggle_step_state} 4 | \alias{toggle_step_state} 5 | \title{Toggle step state} 6 | \usage{ 7 | toggle_step_state(id, state = TRUE, automatic_steps = TRUE, asis = TRUE) 8 | } 9 | \arguments{ 10 | \item{id}{ID of step to be toggled} 11 | 12 | \item{state}{State of the step, \code{TRUE} stands for enabled} 13 | 14 | \item{automatic_steps}{Whether to toggle focus of next step automatically} 15 | 16 | \item{asis}{When used inside of Shiny module, \code{TRUE} will disable adding 17 | the namespace to \code{id}} 18 | } 19 | \description{ 20 | Toggle step state 21 | } 22 | \seealso{ 23 | steps 24 | } 25 | -------------------------------------------------------------------------------- /man/uiinput.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/input.R 3 | \name{uiinput} 4 | \alias{uiinput} 5 | \title{Create Semantic UI Input} 6 | \usage{ 7 | uiinput(..., class = "") 8 | } 9 | \arguments{ 10 | \item{...}{Other arguments to be added as attributes of the tag (e.g. style, class or childrens etc.)} 11 | 12 | \item{class}{Additional classes to add to html tag.} 13 | } 14 | \description{ 15 | This creates an input shell for the actual input 16 | } 17 | \examples{ 18 | #' ## Only run examples in interactive R sessions 19 | if (interactive()) { 20 | library(shiny) 21 | library(shiny.semantic) 22 | 23 | ui <- semanticPage( 24 | uiinput(icon("dog"), 25 | numeric_input("input", value = 0, label = "") 26 | ) 27 | ) 28 | 29 | server <- function(input, output, session) { 30 | } 31 | 32 | shinyApp(ui, server) 33 | } 34 | 35 | } 36 | \seealso{ 37 | text_input 38 | } 39 | -------------------------------------------------------------------------------- /man/uirender.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/uirender.R 3 | \name{uirender} 4 | \alias{uirender} 5 | \title{Render semanticui htmlwidget} 6 | \usage{ 7 | uirender(ui, width = NULL, height = NULL, element_id = NULL) 8 | } 9 | \arguments{ 10 | \item{ui}{UI, which will be wrapped in an htmlwidget.} 11 | 12 | \item{width}{Fixed width for widget (in css units). The default is NULL, 13 | which results in intelligent automatic sizing.} 14 | 15 | \item{height}{Fixed height for widget (in css units). The default is NULL, 16 | which results in intelligent automatic sizing.} 17 | 18 | \item{element_id}{Use an explicit element ID for the widget 19 | (rather than an automatically generated one).} 20 | } 21 | \description{ 22 | htmlwidget that adds semanticui dependencies and 23 | renders in viewer or rmarkdown. 24 | } 25 | \examples{ 26 | library(shiny) 27 | library(shiny.semantic) 28 | uirender( 29 | card( 30 | div( 31 | class="content", 32 | div(class="header", "Elliot Fu"), 33 | div(class="meta", "Friend"), 34 | div(class="description", "Elliot Fu is a film-maker from New York.") 35 | ) 36 | ) 37 | ) 38 | 39 | } 40 | -------------------------------------------------------------------------------- /man/updateSelectInput.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dropdown.R 3 | \name{updateSelectInput} 4 | \alias{updateSelectInput} 5 | \title{Change the value of a select input on the client} 6 | \usage{ 7 | updateSelectInput( 8 | session, 9 | inputId, 10 | label = NULL, 11 | choices = NULL, 12 | selected = NULL 13 | ) 14 | } 15 | \arguments{ 16 | \item{session}{The session object passed to function given to shinyServer.} 17 | 18 | \item{inputId}{The id of the input object.} 19 | 20 | \item{label}{The label to set for the input object.} 21 | 22 | \item{choices}{List of values to select from. If elements of the list are named, 23 | then that name — rather than the value — is displayed to the user.} 24 | 25 | \item{selected}{The initially selected value (or multiple values if multiple = TRUE). 26 | If not specified then defaults to the first value for single-select lists and no 27 | values for multiple select lists.} 28 | } 29 | \description{ 30 | Update selecInput widget 31 | } 32 | \examples{ 33 | ## Only run examples in interactive R sessions 34 | if (interactive()) { 35 | 36 | ui <- semanticPage( 37 | p("The checkbox group controls the select input"), 38 | multiple_checkbox("checkboxes", "Input checkbox", 39 | c("Item A", "Item B", "Item C")), 40 | selectInput("inSelect", "Select input", 41 | c("Item A", "Item B")) 42 | ) 43 | 44 | server <- function(input, output, session) { 45 | observe({ 46 | x <- input$checkboxes 47 | 48 | # Can use character(0) to remove all choices 49 | if (is.null(x)) 50 | x <- character(0) 51 | 52 | # Can also set the label and select items 53 | updateSelectInput(session, "inSelect", 54 | label = paste(input$checkboxes, collapse = ", "), 55 | choices = x, 56 | selected = tail(x, 1) 57 | ) 58 | }) 59 | } 60 | 61 | shinyApp(ui, server) 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /man/update_action_button.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/button.R 3 | \name{update_action_button} 4 | \alias{update_action_button} 5 | \alias{updateActionButton} 6 | \title{Change the label or icon of an action button on the client} 7 | \usage{ 8 | update_action_button(session, input_id, label = NULL, icon = NULL) 9 | 10 | updateActionButton(session, inputId, label = NULL, icon = NULL) 11 | } 12 | \arguments{ 13 | \item{session}{The session object passed to function given to shinyServer.} 14 | 15 | \item{input_id}{The id of the input object.} 16 | 17 | \item{label}{The label to set for the input object.} 18 | 19 | \item{icon}{The icon to set for the input object. To remove the current icon, use icon=character(0)} 20 | 21 | \item{inputId}{the same as \code{input_id}} 22 | } 23 | \description{ 24 | Change the label or icon of an action button on the client 25 | } 26 | \examples{ 27 | 28 | if (interactive()){ 29 | library(shiny) 30 | library(shiny.semantic) 31 | 32 | ui <- semanticPage( 33 | actionButton("update", "Update button"), 34 | br(), 35 | actionButton("go_button", "Go") 36 | ) 37 | 38 | server <- function(input, output, session) { 39 | observe({ 40 | req(input$update) 41 | 42 | # Updates go_button's label and icon 43 | updateActionButton(session, "go_button", 44 | label = "New label", 45 | icon = icon("calendar")) 46 | 47 | }) 48 | } 49 | shinyApp(ui, server) 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /man/update_dropdown_input.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dropdown.R 3 | \name{update_dropdown_input} 4 | \alias{update_dropdown_input} 5 | \title{Update dropdown Semantic UI component} 6 | \usage{ 7 | update_dropdown_input( 8 | session, 9 | input_id, 10 | choices = NULL, 11 | choices_value = choices, 12 | value = NULL 13 | ) 14 | } 15 | \arguments{ 16 | \item{session}{The \code{session} object passed to function given to \code{shinyServer}.} 17 | 18 | \item{input_id}{The id of the input object} 19 | 20 | \item{choices}{All available options one can select from. If no need to update then leave as \code{NULL}} 21 | 22 | \item{choices_value}{What reactive value should be used for corresponding choice.} 23 | 24 | \item{value}{A value to update dropdown to. Defaults to \code{NULL}. 25 | \itemize{ 26 | \item a value from \code{choices} updates the selection 27 | \item \code{character(0)} and \code{""} clear the selection 28 | \item \code{NULL}: 29 | \itemize{ 30 | \item clears the selection if \code{choices} is provided 31 | \item otherwise, \code{NULL} does not change the selection 32 | } 33 | \item a value not found in \code{choices} does not change the selection 34 | }} 35 | } 36 | \description{ 37 | Change the value of a \code{\link{dropdown_input}} input on the client. 38 | } 39 | \examples{ 40 | if (interactive()) { 41 | library(shiny) 42 | library(shiny.semantic) 43 | 44 | ui <- semanticPage( 45 | title = "Dropdown example", 46 | dropdown_input("simple_dropdown", LETTERS[1:5], value = "A", type = "selection multiple"), 47 | p("Selected letter:"), 48 | textOutput("selected_letter"), 49 | shiny.semantic::actionButton("simple_button", "Update input to D") 50 | ) 51 | 52 | server <- function(input, output, session) { 53 | output$selected_letter <- renderText(paste(input[["simple_dropdown"]], collapse = ", ")) 54 | 55 | observeEvent(input$simple_button, { 56 | update_dropdown_input(session, "simple_dropdown", value = "D") 57 | }) 58 | } 59 | 60 | shinyApp(ui, server) 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /man/update_multiple_checkbox.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/checkbox.R 3 | \name{update_multiple_checkbox} 4 | \alias{update_multiple_checkbox} 5 | \alias{update_multiple_radio} 6 | \title{Update checkbox Semantic UI component} 7 | \usage{ 8 | update_multiple_checkbox( 9 | session = getDefaultReactiveDomain(), 10 | input_id, 11 | choices = NULL, 12 | choices_value = choices, 13 | selected = NULL, 14 | label = NULL 15 | ) 16 | 17 | update_multiple_radio( 18 | session = getDefaultReactiveDomain(), 19 | input_id, 20 | choices = NULL, 21 | choices_value = choices, 22 | selected = NULL, 23 | label = NULL 24 | ) 25 | } 26 | \arguments{ 27 | \item{session}{The \code{session} object passed to function given to \code{shinyServer}.} 28 | 29 | \item{input_id}{The id of the input object} 30 | 31 | \item{choices}{All available options one can select from. If no need to update then leave as \code{NULL}} 32 | 33 | \item{choices_value}{What reactive value should be used for corresponding choice.} 34 | 35 | \item{selected}{The initially selected value.} 36 | 37 | \item{label}{The label linked to the input} 38 | } 39 | \description{ 40 | Change the value of a \code{\link{multiple_checkbox}} input on the client. 41 | } 42 | \examples{ 43 | if (interactive()) { 44 | 45 | library(shiny) 46 | library(shiny.semantic) 47 | 48 | ui <- function() { 49 | shinyUI( 50 | semanticPage( 51 | title = "Checkbox example", 52 | form( 53 | multiple_checkbox( 54 | "simple_checkbox", "Letters:", LETTERS[1:5], selected = c("A", "C"), type = "slider" 55 | ) 56 | ), 57 | p("Selected letter:"), 58 | textOutput("selected_letter"), 59 | shiny.semantic::actionButton("simple_button", "Update input to D") 60 | ) 61 | ) 62 | } 63 | 64 | server <- shinyServer(function(input, output, session) { 65 | output$selected_letter <- renderText(paste(input[["simple_checkbox"]], collapse = ", ")) 66 | 67 | observeEvent(input$simple_button, { 68 | update_multiple_checkbox(session, "simple_checkbox", selected = "D") 69 | }) 70 | }) 71 | 72 | shinyApp(ui = ui(), server = server) 73 | 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /man/update_numeric_input.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/input.R 3 | \name{update_numeric_input} 4 | \alias{update_numeric_input} 5 | \alias{updateNumericInput} 6 | \title{Change numeric input value and settings} 7 | \usage{ 8 | update_numeric_input( 9 | session, 10 | input_id, 11 | label = NULL, 12 | value = NULL, 13 | min = NULL, 14 | max = NULL, 15 | step = NULL 16 | ) 17 | 18 | updateNumericInput( 19 | session = getDefaultReactiveDomain(), 20 | inputId, 21 | label = NULL, 22 | value = NULL, 23 | min = NULL, 24 | max = NULL, 25 | step = NULL 26 | ) 27 | } 28 | \arguments{ 29 | \item{session}{The session object passed to function given to shinyServer.} 30 | 31 | \item{input_id}{The id of the input object.} 32 | 33 | \item{label}{The label to set for the input object.} 34 | 35 | \item{value}{The value to set for the input object.} 36 | 37 | \item{min}{Minimum value.} 38 | 39 | \item{max}{Maximum value.} 40 | 41 | \item{step}{Step size.} 42 | 43 | \item{inputId}{the same as \code{input_id}} 44 | } 45 | \description{ 46 | Change numeric input value and settings 47 | } 48 | \examples{ 49 | ## Only run examples in interactive R sessions 50 | if (interactive()) { 51 | library(shiny) 52 | library(shiny.semantic) 53 | 54 | ui <- semanticPage( 55 | slider_input("slider_in", 5, 0, 10), 56 | numeric_input("input", "Numeric input:", 0) 57 | ) 58 | 59 | server <- function(input, output, session) { 60 | 61 | observeEvent(input$slider_in, { 62 | x <- input$slider_in 63 | 64 | update_numeric_input(session, "input", value = x) 65 | }) 66 | } 67 | 68 | shinyApp(ui, server) 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /man/update_progress.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/progress.R 3 | \name{update_progress} 4 | \alias{update_progress} 5 | \title{Update progress Semantic UI component} 6 | \usage{ 7 | update_progress( 8 | session, 9 | input_id, 10 | type = c("increment", "decrement", "label", "value"), 11 | value = 1 12 | ) 13 | } 14 | \arguments{ 15 | \item{session}{The \code{session} object passed to function given to \code{shinyServer}.} 16 | 17 | \item{input_id}{The id of the input object} 18 | 19 | \item{type}{Whether you want to increase the progress bar (\code{"increment"}), decrease the 20 | progress bar (\code{"decrement"}), update the label \code{"label"}, or set it to a specific value (\code{"value"})} 21 | 22 | \item{value}{The value to increase/decrease by, or the value to be set to} 23 | } 24 | \description{ 25 | Change the value of a \code{\link{progress}} input on the client. 26 | } 27 | -------------------------------------------------------------------------------- /man/update_rating.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rating.R 3 | \name{update_rating_input} 4 | \alias{update_rating_input} 5 | \title{Update rating} 6 | \usage{ 7 | update_rating_input(session, input_id, label = NULL, value = NULL) 8 | } 9 | \arguments{ 10 | \item{session}{shiny object with session info} 11 | 12 | \item{input_id}{rating input name} 13 | 14 | \item{label}{character with updated label} 15 | 16 | \item{value}{new rating value} 17 | } 18 | \description{ 19 | Change the value of a rating input on the client. Check 20 | \code{rating_input} to learn more. 21 | } 22 | \examples{ 23 | ## Only run examples in interactive R sessions 24 | if (interactive()) { 25 | library(shiny) 26 | library(shiny.semantic) 27 | 28 | ui <- shinyUI( 29 | semanticPage( 30 | rating_input("rate", "How do you like it?", max = 5, 31 | icon = "heart", color = "yellow"), 32 | numeric_input("numeric_in", "", 0, min = 0, max = 5) 33 | ) 34 | ) 35 | server <- function(session, input, output) { 36 | observeEvent(input$numeric_in, { 37 | x <- input$numeric_in 38 | update_rating_input(session, "rate", value = x) 39 | } 40 | ) 41 | } 42 | shinyApp(ui = ui, server = server) 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /man/update_slider.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/slider.R 3 | \name{update_slider} 4 | \alias{update_slider} 5 | \alias{update_range_input} 6 | \alias{updateSliderInput} 7 | \title{Update slider Semantic UI component} 8 | \usage{ 9 | update_slider(session, input_id, value) 10 | 11 | update_range_input(session, input_id, value, value2) 12 | 13 | updateSliderInput(session, inputId, value, ...) 14 | } 15 | \arguments{ 16 | \item{session}{The \code{session} object passed to function given to \code{shinyServer}.} 17 | 18 | \item{input_id}{The id of the input object} 19 | 20 | \item{value}{The value to be selected for the sldier (lower value if using range).} 21 | 22 | \item{value2}{The upper value of the range.} 23 | 24 | \item{inputId}{Input name.} 25 | 26 | \item{...}{additional arguments} 27 | } 28 | \description{ 29 | Change the value of a \code{\link{slider_input}} input on the client. 30 | } 31 | \examples{ 32 | ## Only run this example in interactive R sessions 33 | if (interactive()) { 34 | shinyApp( 35 | ui = semanticPage( 36 | p("The first slider controls the second"), 37 | slider_input("control", "Controller:", min = 0, max = 20, value = 10, 38 | step = 1), 39 | slider_input("receive", "Receiver:", min = 0, max = 20, value = 10, 40 | step = 1) 41 | ), 42 | server = function(input, output, session) { 43 | observe({ 44 | update_slider(session, "receive", value = input$control) 45 | }) 46 | } 47 | ) 48 | } 49 | 50 | } 51 | \seealso{ 52 | slider_input 53 | } 54 | -------------------------------------------------------------------------------- /man/update_tabset.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/dsl.R 3 | \name{update_tabset} 4 | \alias{update_tabset} 5 | \title{Change the selected tab of a tabset on the client} 6 | \usage{ 7 | update_tabset(session, input_id, selected = NULL) 8 | } 9 | \arguments{ 10 | \item{session}{The session object passed to function given to shinyServer.} 11 | 12 | \item{input_id}{The id of the tabset object.} 13 | 14 | \item{selected}{The id of the tab to be selected.} 15 | } 16 | \description{ 17 | Change the selected tab of a tabset on the client 18 | } 19 | \examples{ 20 | if (interactive()){ 21 | library(shiny) 22 | library(shiny.semantic) 23 | 24 | ui <- semanticPage( 25 | actionButton("changetab", "Select Second Tab"), 26 | tabset( 27 | tabs = list( 28 | list(menu = "First Tab", content = "First Tab", id= "first_tab"), 29 | list(menu = "Second Tab", content = "Second Tab", id = "second_tab") 30 | ), 31 | active = "first_tab", 32 | id = "exampletabset" 33 | ) 34 | ) 35 | 36 | server <- function(input, output, session) { 37 | observeEvent(input$changetab,{ 38 | update_tabset(session, "exampletabset", "second_tab") 39 | }) 40 | } 41 | 42 | shinyApp(ui, server) 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /man/vertical_layout.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/layouts.R 3 | \name{vertical_layout} 4 | \alias{vertical_layout} 5 | \alias{verticalLayout} 6 | \title{Vertical layout} 7 | \usage{ 8 | vertical_layout( 9 | ..., 10 | rows_heights = NULL, 11 | cell_args = "", 12 | adjusted_to_page = TRUE 13 | ) 14 | 15 | verticalLayout(..., fluid = NULL) 16 | } 17 | \arguments{ 18 | \item{...}{Unnamed arguments will become child elements of the layout.} 19 | 20 | \item{rows_heights}{Character or numeric vector indicating the widths of the 21 | individual cells. Recycling will be used if needed.} 22 | 23 | \item{cell_args}{character with additional attributes that should be used for 24 | each cell of the layout.} 25 | 26 | \item{adjusted_to_page}{if TRUE it adjust elements position in equal spaces to 27 | the size of the page} 28 | 29 | \item{fluid}{not supported yet (here for consistency with \code{shiny})} 30 | } 31 | \value{ 32 | vertical layout grid object 33 | } 34 | \description{ 35 | Lays out elements vertically, one by one below one another. 36 | } 37 | \examples{ 38 | if (interactive()) { 39 | ui <- semanticPage( 40 | verticalLayout( 41 | a(href="http://example.com/link1", "Link One"), 42 | a(href="http://example.com/link2", "Link Two"), 43 | a(href="http://example.com/link3", "Link Three") 44 | ) 45 | ) 46 | shinyApp(ui, server = function(input, output) { }) 47 | } 48 | if (interactive()) { 49 | ui <- semanticPage( 50 | vertical_layout(h1("Title"), h4("Subtitle"), p("paragraph"), h3("footer")) 51 | ) 52 | shinyApp(ui, server = function(input, output) { }) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /man/warn_unsupported_args.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{warn_unsupported_args} 4 | \alias{warn_unsupported_args} 5 | \title{Warn that there are not supported arguments} 6 | \usage{ 7 | warn_unsupported_args(args) 8 | } 9 | \arguments{ 10 | \item{args}{list or vector with extra arguments} 11 | } 12 | \description{ 13 | This throws warning if there are parameters not supported by semantic. 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /pkgdown/extra.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --primary-color: #F4B830; 3 | } 4 | 5 | .navbar { 6 | background-color: var(--primary-color) !important; 7 | } 8 | 9 | #navbar > ul.navbar-nav > li.nav-item a:hover { 10 | background-color: var(--primary-color) !important; 11 | } 12 | 13 | #navbar > ul.navbar-nav > li.nav-item a { 14 | color: rgba(255, 255, 255, 0.75); 15 | } 16 | 17 | .navbar-dark .navbar-nav .active > .nav-link { 18 | background-color: var(--primary-color) !important; 19 | color: #fff !important; 20 | } 21 | 22 | .navbar-brand { 23 | color: #fff !important; 24 | } 25 | 26 | .navbar-dark input[type="search"] { 27 | background-color: #fff !important; 28 | color: #444 !important; 29 | } 30 | 31 | nav .text-muted { 32 | color: #d8d8d8 !important; 33 | } 34 | 35 | a { 36 | color: var(--primary-color); 37 | } 38 | 39 | a:hover { 40 | color: #2c2b2b; 41 | } 42 | 43 | button.btn.btn-primary.btn-copy-ex { 44 | background-color: var(--primary-color); 45 | border-color: var(--primary-color); 46 | } 47 | 48 | .home { 49 | left: 0px; 50 | position: absolute; 51 | padding: 8px 30px; 52 | color: rgba(255,255,255,0.55); 53 | } 54 | 55 | .home:hover { 56 | color: rgba(255,255,255,0.9); 57 | } 58 | -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/pkgdown/favicon/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/pkgdown/favicon/apple-touch-icon-144x144.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/pkgdown/favicon/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/pkgdown/favicon/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/pkgdown/favicon/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/pkgdown/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/pkgdown/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/pkgdown/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Appsilon/shiny.semantic/a46ec6b7ca0778b32a0562030259d4d846400127/pkgdown/favicon/favicon.ico -------------------------------------------------------------------------------- /shiny.semantic.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | PackageCheckArgs: --as-cran 22 | PackageRoxygenize: rd,collate,namespace 23 | -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(shiny.semantic) 3 | 4 | test_check("shiny.semantic") 5 | -------------------------------------------------------------------------------- /tests/testthat/setup-disable-crashpad.R: -------------------------------------------------------------------------------- 1 | # ❯ checking for detritus in the temp directory ... NOTE 2 | # Found the following files/directories: 3 | # ‘Crashpad’ 4 | # 5 | # 0 errors ✔ | 0 warnings ✔ | 1 note ✖ 6 | # Error: Error: R CMD check found NOTEs 7 | # Flavors: ubuntu-22.04 (devel), ubuntu-22.04 (release), ubuntu-22.04 (oldrel) 8 | 9 | # References (shinytest2 github): 10 | # 1. https://github.com/rstudio/shinytest2/blob/main/cran-comments.md 11 | # 2. https://github.com/rstudio/shinytest2/blob/main/tests/testthat/setup-disable-crashpad.R 12 | 13 | # Disable crash reporting on CRAN machines. (Can't get the report anyways) 14 | chromote::set_chrome_args(c( 15 | # https://peter.sh/experiments/chromium-command-line-switches/#disable-crash-reporter 16 | #> Disable crash reporter for headless. It is enabled by default in official builds 17 | "--disable-crash-reporter", 18 | chromote::default_chrome_args() 19 | )) 20 | 21 | # Make sure the temp folder is removed when testing is complete 22 | withr::defer({ 23 | 24 | # Clean up chromote sessions 25 | gc() # Run R6 finalizer methods 26 | Sys.sleep(2) # Wait for any supervisors to exit 27 | 28 | # Delete the Crashpad folder if it exists 29 | unlink(file.path(tempdir(), "Crashpad"), recursive = TRUE) 30 | }, envir = testthat::teardown_env()) 31 | -------------------------------------------------------------------------------- /tests/testthat/test_button.R: -------------------------------------------------------------------------------- 1 | context("button") 2 | 3 | test_that("test button", { 4 | # type 5 | expect_is(button("simple_button", "Button!"), "shiny.tag") 6 | # empty input 7 | expect_error(button()) 8 | # text input 9 | si_str <- as.character(button("simple_button", "Button!")) 10 | expect_true(any(grepl("