close the nextui accordion not by clicking it
Unanswered
Asiatic Lion posted this in #help-forum
Asiatic LionOP
but with a state variable, is it possible?
11 Replies
Sure its possible. you using shadcn?
Asiatic LionOP
oh it needs to be controlled
yep
Asiatic LionOP
okay fixed 

Lol NJ. Make sure to close your post please 🙂
Asiatic LionOP
everytime i ask on discord, i inmediately solve the problem
No worries man. If you can provide the example of how you fixed it and mark it as the answer. Just so if anyone else has this problem they can find it archived!
Asiatic LionOP
cool, give me some minutes
np!
Asiatic LionOP
if you set this to an empty array you can close it, but it needs to be controlled
const [expandedKeys, setExpandedKeys] = useState<Set<Key>>(new Set<Key>(['item1']));Original message was deleted
Use this to mark the answer 🙂