-
Hi, I'm following the example here Probably being silly, but I can't work out how to open the panel by default & close it on click, any pointers appreciated? import { Disclosure, Transition } from '@headlessui/react'
function MyDisclosure() {
return (
<Disclosure>
{({ open }) => (
<>
<Disclosure.Button>Is team pricing available?</Disclosure.Button>
{/*
Use the Transition + open render prop argument to add transitions.
*/}
<Transition
show={open}
enter="transition duration-100 ease-out"
enterFrom="transform scale-95 opacity-0"
enterTo="transform scale-100 opacity-100"
leave="transition duration-75 ease-out"
leaveFrom="transform scale-100 opacity-100"
leaveTo="transform scale-95 opacity-0"
>
{/*
Don't forget to add `static` to your Disclosure.Panel!
*/}
<Disclosure.Panel static>{/* ... */}</Disclosure.Panel>
</Transition>
</>
)}
</Disclosure>
)
}```
Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
sajrashid
Nov 17, 2021
Replies: 1 comment 1 reply
-
I got it,
Thanks |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
sajrashid
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got it,
<Disclosure defaultOpen="open">
Thanks