New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

embla-carousel-aria

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

embla-carousel-aria

An accessibility plugin for Embla Carousel

  • 8.0.0-rc19
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
936
decreased by-27.44%
Maintainers
1
Weekly downloads
 
Created
Source

Embla Carousel

This plugin adds ARIA-spec compliance to the amazing Embla Carousel

NPM

Installation

First you need to follow the installation instructions for Embla Carousel, after that you can add aria support:

npm install --save embla-carousel-aria  # yarn add embla-carousel-aria

JavaScript / TypeScript

import EmblaCarousel from 'embla-carousel';
import AriaPlugin from 'embla-carousel-aria';

// initialize Embla Carousel
const embla = EmblaCarousel(
  emblaNode,
  {
    inViewThreshold: 0.25, // A high view threshold is recommended.
  },
  [AriaPlugin()]
);

React

import { useEmblaCarousel } from 'embla-carousel-react';
import AriaPlugin from 'embla-carousel-aria';

const EmblaCarouselComponent = ({ children }) => {
  const [emblaRef, embla] = useEmblaCarousel(
    {
      inViewThreshold: 0.25, // A high view threshold is recommended.
    },
    [AriaPlugin()]
  );

  // ...
};

Options

locale

Type: string
Default: en-US

Locale to be used in IETF's BCP 47 format.

live

Type: false | "off" | "polite" | "assertive"
Default: false

Whether the screen reader should announce slide changes. Recommended to be turned off if autoscroll is used.

debounce

Type: number
Default: 300

The debounce to use when updating aria properties.

onFocusChange

Type: Function
Default: (evt: HTMLElement, target: HTMLElement) => void

A callback function that is invoked when the focus is moved by the Aria plugin.

Global Options

You can also set global options that will be applied to all instances. This allows for overriding the default plugin options with your own:

AriaPlugin.globalOptions = {
  debounce: 1000,
};

OS & Browser Support

  • Mac OS (Chrome, Firefox, Safari, Edge), Magic Mouse, Magic Trackpad
  • Windows (Chrome, Firefox, Edge), Microsoft Precision Touchpads

Thanks

Kudos to David Jerleke for creating Embla Carousel with its open API 🙏

License

MIT.

Keywords

FAQs

Package last updated on 02 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc