Skip to main content

useShopNavigation

Navigates to native Shop app screens (product details, shop profiles, orders, checkout, cart) while maintaining the Mini in the navigation stack. The Mini stays loaded in memory, so back navigation returns to your Mini. Use this when directing users to Shop-managed screens. It preserves native navigation animations, back button behavior, and keeps your Mini's session alive.

Anchor to useShopNavigation
useShopNavigation()

UseShopNavigationReturns

navigateToCart
() => Promise<void>

Navigates to the cart screen.

navigateToCheckout
(params: ) => Promise<void>

Navigates to a checkout.

navigateToOrder
(params: ) => Promise<void>

Navigates to an order.

navigateToProduct
(params: ) => Promise<void>

Navigates to a product.

navigateToShop
(params: ) => Promise<void>

Navigates to a shop.

Examples
import {useShopNavigation, Button} from '@shopify/shop-minis-react'

export default function MyComponent() {
const {navigateToProduct, navigateToShop, navigateToOrder, navigateToCheckout} =
useShopNavigation()

return (
<>
<Button
onClick={() =>
navigateToProduct({productId: 'gid://shopify/Product/123'})
}
>
View Product
</Button>
<Button
onClick={() =>
navigateToShop({
shopId: 'gid://shopify/Shop/123',
})
}
>
Go to Shop
</Button>
<Button
onClick={() => navigateToOrder({orderId: 'gid://shopify/Order/123'})}
>
View Order
</Button>
<Button
onClick={() => navigateToCheckout({shopId: 'gid://shopify/Shop/123'})}
>
Go to Checkout
</Button>
</>
)
}
Was this page helpful?