1.14.1-beta.0 • Published 3 months ago
@squiz/xaccel-accessibility v1.14.1-beta.0
Accessibility Utilities
Description
The utilities under accessibility include: a hook for making card-like design patterns into a fully-clickable area and a hook for enabling keyboard inputs to navigate overlays.
useAccessibleCard
Hook Properties
Property | Property description | Property type | Is required |
---|---|---|---|
cardRef | Reference to the Card element | HTMLElement | x |
linkRef | Reference to the Link that should be fully-clickable | HTMLAnchorElement | x |
Usage
import { useAccessibleCard } from '@squiz/xaccel-accessibility';
function CardListItem({ url, title, description }) {
const { cardRef, linkRef } = useAccessibleCard();
return (
<li ref={cardRef}>
<a href={url} ref={linkRef}>{title}</a>
<p>{description}</p>
</li>
);
}
useKeyboardOverlayListControl
Hook Properties
Property | Property description | Property type | Is required |
---|---|---|---|
openActionRef | Reference to the Button element | HTMLButtonElement | x |
childItems | Element that can be navigated through by keyboard | HTMLElement[] | x |
Usage
const Component = React.forwardRef(({ ...props }, ref) => {
const buttonRef = ref || useRef();
const { containerProps, items, isOpen, setIsOpen } = useKeyboardOverlayListControl({
openActionRef: buttonRef,
childItems: children,
});
});
1.14.1-beta.0
3 months ago
1.14.0
3 months ago
1.13.0-alpha.9
3 months ago
1.14.0-beta.3
3 months ago
1.13.1
3 months ago
1.14.0-beta.2
3 months ago
1.13.0-alpha.7
3 months ago
1.12.2
4 months ago
1.12.1-beta.3
4 months ago
1.12.1
4 months ago
1.12.1-beta.2
4 months ago
1.13.0-beta.1
4 months ago
1.9.1-alpha.0
4 months ago
1.12.1-alpha.0
4 months ago
1.9.1-beta.0
4 months ago
1.9.0
4 months ago
1.9.0-beta.36
4 months ago
1.10.0-alpha.12
6 months ago
1.10.0-alpha.5
7 months ago
1.9.0-alpha.3
7 months ago
1.9.0-beta.1
7 months ago
1.6.0-beta.0
7 months ago
1.6.0-alpha.4
7 months ago
1.5.1-beta.3
7 months ago
1.5.0-beta.0
7 months ago
1.4.2-beta.0
7 months ago
1.4.2-alpha.0
7 months ago
1.2.0
9 months ago
1.1.0
9 months ago