我正在尝试更改我的一些 Shiny UI 元素的外观,使它们更符合网站其余部分的美学。
具体来说,我正在寻找一种方法来移除 selectInput
框的圆边,使其看起来像这样:
其次,我希望制作一个类似于以下内容的 numericInput
框:
有没有简单的方法来做到这一点?我在 R 中很舒服,但不知道大量的 css 或 html。我想过在 numericInput
的两侧添加 actionButton
元素以用作加号/减号键,但还没有想出如何使它们看起来像上面那样。
是否可以合并任何样式属性或 javascript 库来实现这两件事?
最佳答案
正如 ash 评论的那样,对于第一个问题,您可以通过将 border-radius
设置为 0px
来移除舍入:
shinyApp(
ui=fluidPage(
tags$head(
tags$style(".selectize-input {border-radius:0px}"),
tags$style(".selectize-input.dropdown-active {border-radius:0px}"),
tags$style(".selectize-dropdown {border-radius:0px}")),
selectInput("select", "Select", 1:3)),
server=function(input, output){})
关于javascript - 更改 selectInput 和 numericInput 框的外观/形状,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43771015/