96jd-accessibility-utils
v18.0.5
Published
Utility for accessibility handling
Downloads
115
Maintainers
Readme
96jd-accessibility-utils
Installation
NPM
npm install 96jd-accessibility-utils
YARN
yarn add 96jd-accessibility-utils
PNPM
pnpm add 96jd-accessibility-utils
BUN
bun add 96jd-accessibility-utils
Getting started
import { isCancelPressed, isEnterPressed } from "96jd-accessibility-utils";
import { KeyboardEvent } from "react";
export default function App() {
const handleKeyDown = (e: KeyboardEvent) => {
console.log(isEnterPressed(e));
console.log(isCancelPressed(e));
};
return <input type="text" onKeyDown={handleKeyDown} />;
}