{
+ if (e.key === "Enter" || e.key === " ") {
+ handleClick();
+ }
+ }}
+>
+
内部のブロック要素
+
+```
+
+- `role="button"`:スクリーンリーダーにこの要素がボタンであることを知らせます。
+- `tabIndex={0}`:キーボードでフォーカスできるようにします。
+- `onKeyDown`:キーボードアクセシビリティのため、EnterまたはSpaceキー入力時にクリック相当の動作を発生させます。
+
+### 3. `react-aria`を使う
+
+[React-Aria](https://react-spectrum.adobe.com/react-aria/index.html)ライブラリの [`useButton`](https://react-spectrum.adobe.com/react-aria/useButton.html)フックを使うと、アクセシブルなボタンをより簡単に実装できます。このフックは `role`、`tabIndex`、`onKeyDown` などの必須アクセシビリティ設定をまとめて提供してくれるため、個別に扱う必要がありません。
+
+```jsx
+import { useButton } from "react-aria";
+
+const buttonRef = useRef < HTMLDivElement > null;
+const { buttonProps } = useButton(
+ {
+ elementType: "div",
+ onPress: handleClick
+ },
+ buttonRef
+);
+
+