Description Usage Arguments Details Value See Also Examples
View source: R/jseval_and_hooks.R
The 'useDisclosure' hook.
1 | useDisclosure(defaultIsOpen = FALSE)
|
defaultIsOpen |
Boolean, the initial value of the |
See useDisclosure.
A list containing some URL-encoded JavaScript code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | 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)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.