Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time
September 3, 2020 22:38
October 20, 2020 06:02
October 20, 2020 06:02
October 20, 2020 06:03
May 16, 2018 03:06
April 6, 2021 11:07
July 5, 2020 09:46
October 20, 2020 06:03
April 8, 2021 10:06


🔥 HEADS UP! You are in the Vue 2 compatible branch, check the branch for Vue 3 support.

Helps people who only use the keyboard to jump to what matters most

The population grows very fast nowadays and with that the number of visually impaired increases as well. Did you know that we have over 350 million visually impaired people in the world?

However, we are responsible for doing our utmost to make our applications usable and accessible to everyone.

"Skip to content" or "skip to a section" of your site is one of the most common accessibility techniques today, but not as used as it should be.

This pattern is detailed in the Techniques for WCAG 2.0 in notes G1 and G124, and also served as the inspiration for creating this component.

Check out the live demo!


// npm
npm install -S @vue-a11y/skip-to

// yarn
yarn add @vue-a11y/skip-to



// main.js

import Vue from 'vue'
import VueSkipTo from '@vue-a11y/skip-to'


new Vue({
// App.vue

  <div id="app">
    <VueSkipTo to="#main" label="Skip to main content" />

    <!-- header, navigation, and more -->

    <main id="main">
      <!-- content -->

export default {
  name: 'app'
  components: {

Skip-to list

To use multiple links, set an array into the to prop with the following shape:

    "anchor": "<STRING>", // destination id
    "label": "<STRING>" // link text
// App.vue

  <div id="app">
      list-label="Skip to"
        { anchor: '#main', label: 'Main content' },
        { anchor: '#footer', label: 'Footer' },

    <!-- header, navigation, and more -->

    <main id="main"></div>

    <footer id="footer"></div>

In HTML files

<!--omitted -->
  <script src=""></script>
  <script src=""></script>
  <div id="app">
    <vue-skip-to to="#main"></vue-skip-to>

    <!-- header, navigation, and more -->

    <main id="main">
      <!-- content -->

    new Vue({
      el: "#app"


Prop Data Type required Description Default
to String | Array false Destination ID or array of destination objects '#main'
label String false Skip link text content 'Skip to main content'
list-label String false Skip link list label text 'Skip to'

Support route change

@vue-a11y/skip-to checks if you are using the vue-router, watches changes to $route.path and send focus to the vue-skip-to wrapper.

Recommendation: To make more sense, use the VueSkipTo component right after the root element of your app.

Read more about accessible routing:

Custom styling

Override the default styles by targeting the following:

.vue-skip-to {
.vue-skip-to__link {
.vue-skip-to__nav {
.vue-skip-to__nav-list {
.vue-skip-to__nav-list-item {

Running tests

git clone
npm install
npm run dev
npm run test:e2e

Or run Cypress on interactive mode

npm run test:e2e:open


This component was inspired by this article.

  • This component working in all modern browsers and IE9;
  • Ensures that the target element receives focus, even if it is not a tag that naturally receives focus as the tag input and a. In this case, the div are also given the focus and the tabindex attribute with the value of -1;
  • Add focus to the destination, even when the address bar already has the corresponding hash;


  • From typos in documentation to coding new features;
  • Check the open issues or open a new issue to start a discussion around your feature idea or the bug you found;
  • Fork repository, make changes and send a pull request;

Follow us on Twitter @vue_a11y

Thank you


It helps people who only use the keyboard to jump to what matters most.




Code of conduct




Sponsor this project


No packages published