0

与herehere相关的问题,我想从ShinyWidgets更改pickerInput菜单的CSS。我正在使用 flexdashboard,我希望样式与 selectInput 菜单中的样式完全匹配。我意识到我可以通过将 YAML 中的整体主题设置为引导程序来做到这一点,但我不想使用全局解决方案。

---
title: "Testing picker styles"
output: 
  flexdashboard::flex_dashboard
runtime: shiny
---
  
```{r setup, include=F}
library(shiny)
library(flexdashboard)
library(shinyWidgets)
```

Column 
-----------------------------------------------------------------------
  
```{r}
selectInput(inputId = "id1", label = "Select input", choices = attr(UScitiesD, "Labels"))
pickerInput(inputId = "id2", label = "Picker input", choices = attr(UScitiesD, "Labels"))
```

在此处输入图像描述

4

1 回答 1

1

pickerInput样式类似于 Bootstrap 按钮,并且 {flexdashboard} 使用 Bootswatch 的 Cosmo 主题 ( https://bootswatch.com/3/cosmo/ ),这就是它显示为黑色的原因。

您可以使用以下命令更改按钮的类别:

options = pickerOptions(style = "btn-link")

(在pickerInput争论中)

在此处输入图像描述

或者您可以像这样覆盖基本样式:

options = list("style-base" = "form-control", style = "")

在此处输入图像描述

于 2020-06-24T15:37:51.177 回答