% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/disabled.R
\name{disabled}
\alias{disabled}
\title{Initialize a Shiny input as disabled}
\usage{
disabled(...)
}
\arguments{
\item{...}{Shiny input (or tagList or list of of tags that include inputs) to
disable.}
}
\value{
The tag (or tags) that was given as an argument in a disabled state.
}
\description{
Create a Shiny input that is disabled when the Shiny app starts. The input can
be enabled later with \code{\link[=toggleState]{toggleState()}} or \code{\link[=enable]{enable()}}.
}
\note{
\code{shinyjs} must be initialized with a call to \code{useShinyjs()}
in the app's ui.
}
\examples{
if (interactive()) {
  library(shiny)
  shinyApp(
    ui = fluidPage(
      useShinyjs(),  # Set up shinyjs
      actionButton("btn", "Click me"),
      disabled(
        textInput("element", NULL, "I was born disabled")
      )
    ),
    server = function(input, output) {
      observeEvent(input$btn, {
        enable("element")
      })
    }
  )
}

library(shiny)
disabled(numericInput("num", NULL, 5), dateInput("date", NULL))
}
\seealso{
\code{\link[=useShinyjs]{useShinyjs()}}, \code{\link[=toggleState]{toggleState()}}, \code{\link[=enable]{enable()}}, \code{\link[=disable]{disable()}}
}
