You can access the sidebar state with alpine like this, and then show your component only when it's open
x-data="{ get isOpen() { return $store.sidebar.isOpen } }" x-show="isOpen"