Socket
Socket
Sign inDemoInstall

@leafygreen-ui/a11y

Package Overview
Dependencies
86
Maintainers
5
Versions
32
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @leafygreen-ui/a11y

leafyGreen UI Kit A11y


Version published
Weekly downloads
35K
increased by25.98%
Maintainers
5
Install size
9.08 MB
Created
Weekly downloads
 

Readme

Source

A11y

npm (scoped)

Installation

Yarn

yarn add @leafygreen-ui/a11y

NPM

npm install @leafygreen-ui/a11y

Example

import { VisuallyHidden } from '@leafygreen-ui/a11y';

const Button = () => {
  return (
    <button>
      <svg role="presentation" aria-hidden />
      <VisuallyHidden>Click me</VisuallyHidden>
    </button>
  );
};

Output HTML

<button>
  <svg role="presentation" aria-hidden="true" />
  <div>Click me</div>
</button>

VisuallyHidden

Properties

PropTypeDescriptionDefault
childrenstringText that is announced to screen readers but is hidden from the screen.

useAccessibleFormField

Hook that returns two sets of props that accessibly associate a label and its respective input element

Properties

ParameterTypeDescriptionDefault
idstringid that describes the input element.

validateAriaLabelProps

Function that validates that either aria-label or aria-labelledby are present within props.

Properties

ParameterTypeDescriptionDefault
propsRecord<string, any>Object of component properties.
componentNamestringName of component with props to be validated.

prefersReducedMotion

Returns an emotion CSS instance for rendering styles that respect OS-level preferences for reduced motion.

Use this function to remove scale, size, and positional transitions for users with that preference set.

Properties

ParameterTypeDescriptionDefault
stylesstringString of styles to render within preference media query.

FAQs

Last updated on 26 Mar 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc