Generic way to show/hide arbitrary content on the page using react-aria #2588
-
There are many common components that allows for showing/hiding some content, like tabs, accordions, modal dialogs and so on. But sometimes you just need something simpler, closer to html |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
I don't think React Aria has exactly what you need at the moment, but I would recommend taking a look at implementing something similar to react-spectrum/packages/@react-aria/accordion/src/useAccordion.ts Lines 36 to 65 in 0571f1c i.e. change state from TreeState to something with just Maybe someone else can chime in if they're aware of an easier solution. |
Beta Was this translation helpful? Give feedback.
Although, it might be better just to use our existing Accordion and contribute anything you find that is missing. Read up on benefits of the accordion pattern vs others: https://www.hassellinclusion.com/blog/accessible-accordions-part-2-using-details-summary/