How to use react accessible drawer with portal?

Hi there,

I’m trying to create a slide out component that uses react-accessible-drawer and can be called from a button anywhere in the app. I “think” it can do what I want, but I’m not sure how to link it up properly with refs, and or portals.

Here is a codesandbox where I’m stuck -> (

The ideal situation is this:

  • I have a button outside the slide out component that triggers the slide out component to open
  • I can pass into the Slide out component any child elements I like
  • I am aiming to have multiple buttons in the app to trigger the slide out, but with different content from each button click.

Does that make sense?

Thank you in advance!

I actually just rolled my own solution here -

Will do for now :slight_smile: