{"id":14067631,"url":"https://github.com/deepanshu88/shinyDarkmode","last_synced_at":"2025-07-30T02:30:52.772Z","repository":{"id":140127839,"uuid":"350277803","full_name":"deepanshu88/shinyDarkmode","owner":"deepanshu88","description":"Add Darkmode in Shiny App","archived":false,"fork":false,"pushed_at":"2022-08-23T12:49:43.000Z","size":444,"stargazers_count":10,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-04T08:36:08.993Z","etag":null,"topics":["r","rstats","shiny"],"latest_commit_sha":null,"homepage":"https://www.listendata.com/2021/03/shinydarkmode-add-darkmode-to-shiny-apps.html","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepanshu88.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-03-22T09:11:34.000Z","updated_at":"2024-10-16T08:59:47.000Z","dependencies_parsed_at":"2024-02-19T19:15:59.182Z","dependency_job_id":"8afc2116-25a8-45b2-b87c-5123d4ec7b05","html_url":"https://github.com/deepanshu88/shinyDarkmode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/deepanshu88/shinyDarkmode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepanshu88%2FshinyDarkmode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepanshu88%2FshinyDarkmode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepanshu88%2FshinyDarkmode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepanshu88%2FshinyDarkmode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepanshu88","download_url":"https://codeload.github.com/deepanshu88/shinyDarkmode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepanshu88%2FshinyDarkmode/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267798625,"owners_count":24145727,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["r","rstats","shiny"],"created_at":"2024-08-13T07:05:41.961Z","updated_at":"2025-07-30T02:30:52.441Z","avatar_url":"https://github.com/deepanshu88.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# shinyDarkmode\n\n\u003c!-- badges: start --\u003e\n\u003c!-- badges: end --\u003e\n\nIn this package we use [darkmodejs](https://darkmodejs.learn.uno/) which enables a darkmode to your shiny app in a few seconds.\n\n## Installation\n\nYou can install the released version of shinyDarkmode from Github with:\n\n``` r\n# install.packages(\"remotes\")\nremotes::install_github(\"deepanshu88/shinyDarkmode\")\n```\n\n## Example\n\nThis is a basic example which shows you how to add darkmode. To know how to add darkmode with custom checkbox, check out the complete documentation of [shinyDarkmode](https://listendata.com/)\n\n```{r example, eval=FALSE, include=TRUE}\nlibrary(shiny)\nlibrary(shinyDarkmode)\n \n vars \u003c- setdiff(names(iris), \"Species\")\n ui \u003c- fluidPage(\n\n   titlePanel(\"Sample App\"),\n\n   # Setup\n   use_darkmode(),\n\n   sidebarPanel(\n     selectInput('xcol', 'X Variable', vars),\n     selectInput('ycol', 'Y Variable', vars, selected = vars[[2]]),\n     numericInput('clusters', 'Cluster count', 3, min = 1, max = 9)\n   ),\n   mainPanel(\n     plotOutput('plot1')\n   ),\n\n   column(width = 12,\n          DT::dataTableOutput(\"mydt\")\n   )\n )\n\n # Server\n server \u003c- function(input, output, session) {\n\n   darkmode(session, label = \"⏳\")\n\n   # Combine the selected variables into a new data frame\n   selectedData \u003c- reactive({\n     iris[, c(input$xcol, input$ycol)]\n   })\n\n   clusters \u003c- reactive({\n     kmeans(selectedData(), input$clusters)\n   })\n\n   output$plot1 \u003c- renderPlot({\n     palette(c(\"#E41A1C\", \"#377EB8\", \"#4DAF4A\", \"#984EA3\",\n               \"#FF7F00\", \"#FFFF33\", \"#A65628\", \"#F781BF\", \"#999999\"))\n\n     par(mar = c(5.1, 4.1, 0, 1))\n     plot(selectedData(),\n          col = clusters()$cluster,\n          pch = 20, cex = 3)\n     points(clusters()$centers, pch = 4, cex = 4, lwd = 4)\n   })\n\n   output$mydt \u003c- DT::renderDataTable(iris,\n                                      options = list(pageLength = 10, autoWidth = TRUE),\n                                      rownames= FALSE)\n\n }\n\n # Run App\n shinyApp(ui = ui, server = server)\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepanshu88%2FshinyDarkmode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepanshu88%2FshinyDarkmode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepanshu88%2FshinyDarkmode/lists"}