> ## Documentation Index
> Fetch the complete documentation index at: https://docs.skybridge.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# useRequestClose

> Dismiss the view from inside your app

When a [view](https://docs.skybridge.tech/build/view.md) has run its course, dismissing it hands the user back to the conversation instead of leaving a spent panel on screen. `useRequestClose` asks the host to do that; the host owns the decision.

## Example

After the order is placed, a "Done" button dismisses the confirmation and hands the shopper back to the conversation.

```tsx highlight={2,5,10} theme={null}
import { useState } from "react";
import { useRequestClose } from "skybridge/web";

function CheckoutConfirmation() {
  const requestClose = useRequestClose();
  const [closing, setClosing] = useState(false);

  const handleDone = async () => {
    setClosing(true);
    await requestClose();
  };

  return (
    <div>
      <p>Your order is on its way.</p>
      <button disabled={closing} onClick={handleDone}>
        {closing ? "Closing..." : "Done"}
      </button>
    </div>
  );
}
```

## Returns

`useRequestClose` returns a single function.

### `requestClose`

```tsx theme={null}
requestClose(): Promise<void>;
```

Asks the host to dismiss the current view. The promise resolves once the request is sent, not when the view closes: the host owns the decision and returns no acknowledgement, so the view cannot tell whether it was actually dismissed.

> [card] [Design for the Host](https://docs.skybridge.tech/guides/ux.md)
>
> Where dismissing a view fits in the view lifecycle

> [card] [useRequestModal](https://docs.skybridge.tech/api-reference/use-request-modal.md)
>
> Open the modal view you later close

> [card] [useDisplayMode](https://docs.skybridge.tech/api-reference/use-display-mode.md)
>
> Request a different layout instead of closing


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.