Ariakit
/

useToolbarContext

Returns the toolbar store from the nearest toolbar container.

Code examples

function ToolbarItem() {
const store = useToolbarContext();
if (!store) {
throw new Error("ToolbarItem must be wrapped in ToolbarProvider");
}
// 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