4.0.1 • Published 12 months ago

@talend/react-a11y v4.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
12 months ago

React a11y package

This package holds some utility to add accessibility support to any react components.

At the moment it supports The following gesture with keyboard:

  • Tree
  • Calendar
  • List

Calendar

HOC API:

import { Gesture } from '@talend/react-a11y';

function MyCalendar(props) {
	//...
}

export default Gesture.withCalendarGesture(MyCalendar);

props and html structure

In the upper example the HOC will inject onKeyDown props. It manage the focus on the correct day and is able to call props.goToPreviousMonth(cb) or props.goToNextMonth(cb) if needed.

Lookup of item in the dom is based on the following selector: td > button[data-value]

Tree

HOC API:

import { Gesture } from '@talend/react-a11y';

function MyTree(props) {
	//...
}

export default Gesture.withTreeGesture(MyTree);

props and html structure

props:

selectors:

  • root selector: ref.closest('ul[role="tree"]')
  • node selector: root.querySelector('li[role="treeitem"]')

List

HOC API:

import { Gesture } from '@talend/react-a11y';

function MyList(props) {
	//...
}

export default Gesture.withListGesture(MyList);

props and html structure

No props on this one but the following selectors:

  • root selector: ref.closest('ul[role="list"]')
  • node selector: root.querySelector('li[role="listitem"]')
3.1.0

1 year ago

4.0.1

12 months ago

4.0.0

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.3.0

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago