nuxt-a11y
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

nuxt-a11y

This module integrates Axe tool for auditing website against common Accessibility (A11Y) issues.

Setup

yarn add --dev nuxt-a11y # yarn
npm i --save-dev nuxt-a11y # npm

Usage

The only thing you need to do to use the module in the default configuration is to register the module in the modules array in nuxt.config.ts:

// nuxt.config.js

{
  modules: ["nuxt-a11y"],
}

And that's it! You can now use the useA11y composable in your Nuxt app:

<script setup lang="ts">
  const violations = useA11y()
</script>

Now, you have access to the violations that were found by the Axe A11Y tool on the current page. The structure of each violation objects looks more or less like this:

interface Result {
  description: string;
  help: string;
  helpUrl: string;
  id: string;
  impact?: ImpactValue;
  tags: TagValue[];
  nodes: NodeResult[];
}

Development

  • Run npm run dev:prepare to generate type stubs.
  • Use npm run dev to start playground in development mode.

/nuxt-a11y/

    Package Sidebar

    Install

    npm i nuxt-a11y

    Weekly Downloads

    2

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    4.63 kB

    Total Files

    9

    Last publish

    Collaborators

    • baroshem