Returns the composite store from the nearest composite container.

Code examples

function CompositeItem() {
const store = useCompositeContext();
if (!store) {
throw new Error("CompositeItem must be wrapped in CompositeProvider");
// 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