renderUI to create an input that's pre-disabled?

To disable a button you need to set the "disabled" attribute. The disabled attribute is a boolean html attribute which means you means it just needs to be present (e.g. <button disabled>) not have a value (e.g. <button disabled="true">). You can add a boolean attribute in shiny control by setting its value to "":

library(shiny)
actionButton("id", "label", disabled = "")
#> <button id="id" type="button" class="btn btn-default action-button" disabled>
#> </button>

Created on 2020-04-03 by the reprex package (v0.3.0)

3 Likes