npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-skip-to

v1.0.6

Published

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

Downloads

75

Readme

vue-skip-to

It 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.

In addition to being a technique recommended by WCAG 2.0, that's where this component was inspired. https://www.w3.org/TR/WCAG20-TECHS/G1.html
https://www.w3.org/TR/WCAG20-TECHS/G124.html

Install

NPM

npm install -S vue-skip-to

Yarn

yarn add vue-skip-to

How to use

In your main.js

import Vue from 'vue'
import VueSkipTo from 'vue-skip-to'

Vue.use(VueSkipTo)

In your App.vue

<template>
  <div id="app">
    <vue-skip-to to="#main" text="Skip to main content" />

    <logo :src="require('@/assets/logo.png')" />
    <h1 data-va="main header">{{ msg }}</h1>
    ...
    <div id="main" role="main">
      <!-- My content -->
    </div>
  </div>
</template>
<script>
export default {
  name: 'app'
  components: {
    Logo
  },
  //...
}
</script>

Using with HTML files

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

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

    <div id="main" role="main">
      <!-- My content -->
    </div>
  </div>

  <script src="https://unpkg.com/vue"></script>
  <script src="https://unpkg.com/vue-skip-to"></script>
  <script>
    Vue.use(VueSkipTo)
    new Vue({
      el: "#app"
    })

  </script>
</body>
</html>

Check live demo

https://vue-skip-to.surge.sh

Props

Prop | Data Type | required | Description | Default --------------- | ---------- | --------- | ---------------------- | ------------- to | String | false | Set destination ID | #main text | String | false | Text content of link | Skip to main content tabindex | String | false | Specifies the tab order | null

Custom style

You can style the link through the selector .vue-skip-to

Feature

Inspired by this article, to know more, access the link:
http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/

  • 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;

Run the tests

git clone https://github.com/vue-a11y/vue-skip-to.git vue-skip-to
npm install
npm run dev
npm run test

Or run Cypress on interactive mode

npm run test:open

Roadmap

https://github.com/vue-a11y/vue-skip-to/issues/1

Contributing

  • 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;

If you want a faster communication, find me on @ktquez And follow us on Twitter @vue_a11y

Thank you