All Projects → visualjerk → ari

visualjerk / ari

Licence: MIT license
Accessible unstyled vue components

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ari

chusho
A library of bare & accessible components and tools for Vue.js 3
Stars: ✭ 47 (+113.64%)
Mutual labels:  accessibility, a11y, vue-components, vue-component-library
Bootstrap Vue
BootstrapVue provides one of the most comprehensive implementations of Bootstrap v4 for Vue.js. With extensive and automated WAI-ARIA accessibility markup.
Stars: ✭ 13,603 (+61731.82%)
Mutual labels:  accessibility, a11y, wai-aria
sublime-wai-aria
WAI-ARIA Roles, States and Properties auto-completion for Sublime Text
Stars: ✭ 21 (-4.55%)
Mutual labels:  accessibility, a11y, wai-aria
Visible
🦉 Accessibility testing framework at the next level
Stars: ✭ 164 (+645.45%)
Mutual labels:  accessibility, a11y, wai-aria
Chakra Ui Vue
⚡️ Build scalable and accessible Vue.js applications with ease.
Stars: ✭ 993 (+4413.64%)
Mutual labels:  accessibility, a11y, wai-aria
accessibility-testing-tools
A collection of useful tools for accessibility testing and debugging in the browser, online and desktop
Stars: ✭ 18 (-18.18%)
Mutual labels:  accessibility, a11y, wai-aria
Vue Simple Suggest
Feature-rich autocomplete component for Vue.js
Stars: ✭ 324 (+1372.73%)
Mutual labels:  accessibility, vue-components, wai-aria
Js Offcanvas
A lightweight, flexible jQuery off-canvas navigation plugin which lets you create fully accessible sidebar or top/bottom sliding (or push) panels with keyboard interactions and ARIA attributes.
Stars: ✭ 272 (+1136.36%)
Mutual labels:  accessibility, a11y, wai-aria
Reakit
Toolkit for building accessible rich web apps with React
Stars: ✭ 5,265 (+23831.82%)
Mutual labels:  accessibility, a11y, wai-aria
Awesome A11y
A curate list about A11Y ♿️
Stars: ✭ 1,210 (+5400%)
Mutual labels:  accessibility, a11y, wai-aria
Vue Announcer
A simple way with Vue to announce any useful information for screen readers.
Stars: ✭ 185 (+740.91%)
Mutual labels:  accessibility, a11y
Empathy Prompts
💡 Ideas to help consider Inclusive Design principles when making things for others to use.
Stars: ✭ 173 (+686.36%)
Mutual labels:  accessibility, a11y
Capable
Keep track of accessibility settings, leverage high contrast colors, and use scalable fonts to enable users with disabilities to use your app.
Stars: ✭ 189 (+759.09%)
Mutual labels:  accessibility, a11y
Eslint Plugin Jsx A11y
Static AST checker for a11y rules on JSX elements.
Stars: ✭ 2,609 (+11759.09%)
Mutual labels:  accessibility, a11y
Accessible modal window
Accessible modal dialogs
Stars: ✭ 196 (+790.91%)
Mutual labels:  accessibility, a11y
Focusoverlay
Library for creating animated overlays on focused elements
Stars: ✭ 167 (+659.09%)
Mutual labels:  accessibility, a11y
Wai Tutorials
W3C WAI’s Web Accessibility Tutorials
Stars: ✭ 229 (+940.91%)
Mutual labels:  accessibility, a11y
vue-focus-loop
Vue component that helps you to to trap focus in an element.
Stars: ✭ 23 (+4.55%)
Mutual labels:  accessibility, a11y
Asqatasun
Mirror of Asqatasun ---> we've moved to GITLAB https://gitlab.com/asqatasun/Asqatasun - Opensource web site analyser, used for web accessibility "a11y"
Stars: ✭ 217 (+886.36%)
Mutual labels:  accessibility, a11y
agnostic-axe
Framework agnostic accessibility reporter, powered by axe-core
Stars: ✭ 80 (+263.64%)
Mutual labels:  accessibility, a11y

Ari

CI Test Coverage

Accessible unstyled Vue components inspired by Reakit.

Try it on Stackblitz.

Installation

npm i vue-ari

or

yarn add vue-ari

Usage

<template>
  <PopoverDisclosure v-bind="popover">
    Open Popover
  </PopoverDisclosure>
  <Popover v-bind="popover">
    Popover Content
  </Popover>
</template>

<script>
import { Popover, PopoverDisclosure, usePopoverState } from 'vue-ari'

export default {
  components: {
    Popover,
    PopoverDisclosure,
  },
  setup() {
    const popover = usePopoverState()
    return {
      popover,
    }
  },
}
</script>

Styling

Ari components don't include styling by default. This gives you the ability to add styles however you like.

Example Using Tailwind

<template>
  <PopoverDisclosure
    v-bind="popover"
    class="text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline"
  >
    Open Popover
  </PopoverDisclosure>
  <Popover
    v-bind="popover"
    class="rounded shadow-lg border border-solid border-gray-300 py-3 px-5 bg-white"
  >
    Popover Content
  </Popover>
</template>

<script>
import { Popover, PopoverDisclosure, usePopoverState } from 'vue-ari'

export default {
  components: {
    Popover,
    PopoverDisclosure,
  },
  setup() {
    const popover = usePopoverState()
    return {
      popover,
    }
  },
}
</script>

Reusable Components

It would get pretty verbose to add the same styling classes wherever you like to use a Popover. So the recommended way is wrapping Ari components inside your own base components and use them inside your app.

<template>
  <PopoverDisclosure
    v-bind="$props"
    class="text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline"
  >
    <slot />
  </PopoverDisclosure>
</template>

<script>
import { PopoverDisclosure, popoverDisclosureProps } from 'vue-ari'

export default {
  name: 'AppPopoverDisclosure',
  props: popoverDisclosureProps,
  components: {
    PopoverDisclosure,
  },
}
</script>

Abstracting State

If you would rather not create a modal state each time, just create a provider component.

Provider component:

<template>
  <slot />
</template>

<script>
import { provide } from 'vue'
import { useModalState } from 'vue-ari'

export default {
  name: 'AppModalProvider',
  setup() {
    provide('modalState', useModalState())
  },
}
</script>

Base component for disclosure:

<template>
  <ModalDisclosure
    v-bind="modal"
    class="text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline"
  >
    <slot />
  </ModalDisclosure>
</template>

<script>
import { inject } from 'vue'
import { ModalDisclosure } from 'vue-ari'

export default {
  name: 'AppModalDisclosure',
  components: {
    ModalDisclosure,
  },
  setup() {
    const modal = inject('modalState')
    return {
      modal,
    }
  },
}
</script>

Base component for modal:

<template>
  <ModalBackdrop
    v-bind="modal"
    class="fixed inset-0 flex items-center justify-center bg-opacity-75 bg-black"
  >
    <Modal
      v-bind="{ ...modal, ...$attrs }"
      class="max-w-xs rounded shadow-lg border border-solid border-gray-300 py-3 px-5 bg-white"
    >
      <slot />
    </Modal>
  </ModalBackdrop>
</template>

<script>
import { inject } from 'vue'
import { Modal, ModalBackdrop } from 'vue-ari'

export default {
  name: 'AppModalDisclosure',
  components: {
    Modal,
    ModalBackdrop,
  },
  inheritAttrs: false,
  setup() {
    const modal = inject('modalState')
    return {
      modal,
    }
  },
}
</script>

Inside your app:

<template>
  <AppModalProvider>
    <AppModalDisclosure>
      Open Modal
    </AppModalDisclosure>
    <AppModal>
      Modal Content
    </AppModal>
  </AppModalProvider>
</template>

<script>
import { AppModalProvider, AppModal, AppModalDisclosure } from './components'

export default {
  components: {
    AppModalProvider,
    AppModal,
    AppModalDisclosure,
  },
}
</script>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].