In a Shiny app, I'd like to use renderUI to create a new input element (e.g., an actionButton), but I'd like for it to be immediately disabled. I know one can use shinyjs (and equivalent jQuery code) to disable an existing element in the DOM, but I'm wondering about good patterns for guaranteeing that the new input element is never enabled (at least not at first). In the current pattern, the element is added (in enabled form), then disabled ... and I don't know if there's a way to chain these two steps such that it never appears enabled (even for a split second) to the end user.
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 "":