Returns the dialog store from the nearest dialog container.

Code examples

function Dialog() {
const store = useDialogContext();
if (!store) {
throw new Error("Dialog must be wrapped in DialogProvider");
// Use the store...

Stay tuned

Join 1,000+ subscribers and receive monthly tips & updates on new Ariakit content.

No spam. Unsubscribe anytime. Read latest issue