Customizing the disclosure to add slots for actions #3473
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
In addition to general feasibility, would appreciate additional feedback and input on the accessibility of this approach. Is there a challenge around having nested selectable/focusable elements within each other? If so, how might we best include actions with each disclosure object? |
Beta Was this translation helpful? Give feedback.
-
Hi there As per the Disclosure documentation, nested focusable elements are not accessible and should not be implemented.
You can do something pretty similar though which would be perfectly accessible, using the Disclosure Primitive. We've planned to build something called a Summary Detail component for a while, but it's never quite made the prioritization cut. I've knocked up a quick Codesandbox to demo what it might look like. You might take some inspiration from that and build something yourselves, that would be perfectly accessible and so the same job as your design intends. ![]() Essentially, the trigger is separated from the Heading as a sibling, allowing you to have as many actions in line as you like, but still be collapsible. |
Beta Was this translation helpful? Give feedback.
Hi there
As per the Disclosure documentation, nested focusable elements are not accessible and should not be implemented.
You can do something pretty similar though which would be perfectly accessible, using the Disclosure Primitive.
We've planned to build something called a Summary Detail component for a while, but it's never quite made the prioritization cut. I've knocked up a quick Codesandbox to demo what it might look like.
You might take some inspiration from that and build…