| useDisclosure {shinyChakraUI} | R Documentation | 
The 'useDisclosure' hook
Description
The 'useDisclosure' hook.
Usage
useDisclosure(defaultIsOpen = FALSE)
Arguments
| defaultIsOpen | Boolean, the initial value of the  | 
Details
See useDisclosure.
Value
A list containing some URL-encoded JavaScript code.
See Also
Examples
library(shiny)
library(shinyChakraUI)
ui <- chakraPage(
  br(),
  chakraComponent(
    "mycomponent",
    withStates(
      Tag$Fragment(
        Tag$Button(
          colorScheme = "teal",
          variant = "outline",
          onClick = getHookProperty("disclosure", "onToggle"),
          "Click me!"
        ),
        Tag$Fade(
          "in" = getHookProperty("disclosure", "isOpen"),
          Tag$Box(
            p = "40px",
            color = "white",
            mt = "4",
            bg = "teal.500",
            rounded = "md",
            shadow = "md",
            "Fade"
          )
        )
      ),
      states = list(disclosure = useDisclosure())
    )
  )
)
server <- function(input, output, session){}
if(interactive()){
  shinyApp(ui, server)
}
[Package shinyChakraUI version 1.1.1 Index]