---
title: useCloseMini
description: Closes the Mini and returns the user to the Shop app.
source_url:
  html: 'https://shopify.dev/docs/api/shop-minis/hooks/navigation/useclosemini'
  md: 'https://shopify.dev/docs/api/shop-minis/hooks/navigation/useclosemini.md'
api_name: shop-minis
---

# use​Close​Mini

Closes the Mini and returns the user to the Shop app. The Mini's WebView is destroyed and all state is lost. Use this for explicit exit flows (order completed, user cancellation) or when navigation should leave the Mini context entirely. Unlike `useShopNavigation`, which navigates to other Shop screens while keeping the Mini in the navigation stack, this removes the Mini from the stack.

## use​Close​Mini()

### Returns

* **UseCloseMiniReturns**

### UseCloseMiniReturns

* closeMini

  Closes the Mini viewer.

  ```ts
  () => void
  ```

Examples

### Examples

* ####

  ##### tsx

  ```tsx
  import {useCloseMini, Button} from '@shopify/shop-minis-react'

  export function Example() {
    const {closeMini} = useCloseMini()

    return <Button onClick={closeMini}>Close Mini</Button>
  }
  ```

***
