# Recommended way to exit preview

**URL:** <https://community.prismic.io/t/recommended-way-to-exit-preview/594>\
**Category:** Developing with Prismic\
**Tags:** nextjs\
**Created:** [May 29, 2020, 11:33pm UTC](https://community.prismic.io/t/recommended-way-to-exit-preview/594 "2020-05-29T23:33:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![delanebobdesigns](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@delanebobdesigns](https://community.prismic.io/u/delanebobdesigns)\
**Post date:** [May 29, 2020, 11:33pm UTC](https://community.prismic.io/t/recommended-way-to-exit-preview/594/1 "2020-05-29T23:33:53Z")

</div>

Hey,

I'm currently creating a site for a client using Next.js + Prismic.

I have setup the in website preview with the purple toolbar. I was wondering what is the recommended way to allow clients to exit the preview. I can't see anything built into the preview toolbar.

I can see that there was a exit-preview endpoint in the next.js example I used. But there isn't a UI element to interact with it.

Do I just create a custom one myself?

---

<div class="post-metadata">

**Author:** ![Levi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/levi/32/24_2.png) [@Levi](https://community.prismic.io/u/Levi)\
**Post date:** [June 1, 2020, 9:06am UTC](https://community.prismic.io/t/recommended-way-to-exit-preview/594/2 "2020-06-01T09:06:13Z")

</div>

Hi @delanebobdesigns, when you have a preview running, there should be an “X” button in the purple toolbar which will remove the preview cookie and exit the preview:

 ![Screenshot 2020-05-25 at 11.55.06](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/1X/b1d42789f94200a5e57aa6e8f5f79a1b866557df.png)

Give that a try!

---

<div class="post-metadata">

**Author:** ![joao](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/joao/32/433_2.png) [@joao](https://community.prismic.io/u/joao)\
**Post date:** [June 18, 2020, 10:20am UTC](https://community.prismic.io/t/recommended-way-to-exit-preview/594/3 "2020-06-18T10:20:20Z")

</div>

This will close prismic toolbar and clear the prismic preview cookie, however when using next, for example, we also have a local cookie that enables the system to go straight to prismic and get the correct preview content.

When clicking on Prismic X we also need to clear the cookie on our side, commonly done by calling the /api/exit-preview endpoint.

Can we customize the X button so that is also preforms this action when being clicked?

Thank you

---

<div class="post-metadata">

**Author:** ![Levi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/levi/32/24_2.png) [@Levi](https://community.prismic.io/u/Levi)\
**Post date:** [June 18, 2020, 10:26am UTC](https://community.prismic.io/t/recommended-way-to-exit-preview/594/4 "2020-06-18T10:26:32Z")

</div>

@joao Unfortunately this sort of customization isn’t possible and there aren’t any plans currently to add it. I suggest submitting an issue/feature request on the toolbar’s github and/or submitting a PR to add it so our dev team can consider it:

> **[prismicio/prismic-toolbar](https://github.com/prismicio/prismic-toolbar)**
>
> Isn't anymore on npm. Include script static.cdn.prismic.io/prismic.min.js instead - prismicio/prismic-toolbar

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [September 21, 2020, 4:29pm UTC](https://community.prismic.io/t/recommended-way-to-exit-preview/594/5 "2020-09-21T16:29:20Z")

</div>

This issue has been closed due to inactivity.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 5:35pm UTC](https://community.prismic.io/t/recommended-way-to-exit-preview/594/6 "2021-12-09T17:35:40Z")

</div>


