In-Website Edit Button

You can display an edit button on your live website only for your content writers, so they can easily jump from the live website to the Prismic writing room to edit the corresponding document.

Before Reading

This page assumes that you have already included the prismic-vue plugin in your project or that you are using the Prismic Vue.js starter. Check out the Integrating with existing project page to learn how to get setup.

Configure your website for previews

Before configuring an edit button, make sure that your website is configured for previews. It's a requirement for the edit button functionality.

Include the Prismic Toolbar javascript file

You will need to include the Prismic toolbar scripts on every page of your website. This means including it on your 404 page! 

You can find this script in your repository 'Settings' section, under the 'Previews' tab.

Settings > Previews > Script

If in the URL of the Prismic Toolbar script, that you copied from the Previews page of your repository, finishes with ?new=true like the script below. Then you are finished you don't need to read any further.

<script type="text/javascript" src=""></script>

If your <script> has the URL below then keep reading.

<script type="text/javascript" src=""></script>

Note: This edit button will only appear for Admins, Editors and Content Creators, to allow to easily edit your pages. It won't appear for standard website visitors or give them any access or control.

Adding an edit button in your template

Where you want to have an edit button, insert a <prismic-edit-button/> component with a Prismic document ID as prop. You can have several edit buttons on the same page.
See this example:

    <prismic-edit-button :documentId="documentId"/>
    <p>Lorem ipsum...</p>

export default {
  data () {
    return {
      documentId: ''
  methods: {
    getContent () {
        .then((document) => {
          this.documentId =;
  created () {

The Prismic Toolbar will add an <a> element with the class wio-link. You're free to style it as you want to integrate it in your design.