0Pricing
Web Accessibility Academy · レッスン

メニュー、メニューバー、メニューボタン

正しいロールとキー操作でアプリのメニューを実装します。

「メニュー、メニューバー、メニューボタン」はCoddyKit上の無料Web Accessibility Academyレッスンです。 これはレッスン3/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはWeb Accessibility Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Web Accessibility Academyコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

What ARIA Menus Are

An ARIA menu is an app-style list of commands, like the File or Edit menus in desktop software, not your site's main navigation. 🍔

Not for Site Navigation

Page links belong in a nav with normal anchors. Use the menu role only for true command sets, or you will confuse screen reader users.

Three Core Roles

The pattern uses role="menu" for the container, role="menuitem" for each command, and role="menubar" for a horizontal always-visible bar.

<ul role="menu">
  <li role="menuitem">Cut</li>
  <li role="menuitem">Copy</li>
</ul>

The Menu Button

A menu button is a real button that opens a menu. Give it aria-haspopup="true" so users know a popup is coming.

<button aria-haspopup="true"
  aria-expanded="false">Actions</button>

Track Open State

The menu button toggles aria-expanded between true and false as its menu opens and closes, just like any disclosure control.

Move Focus on Open

When the menu opens, move focus into it, onto the first menu item. The button no longer holds focus while the menu is active.

Arrow Keys Inside

Inside a vertical menu, Up and Down Arrow move between items. In a menubar, Left and Right Arrow move along the top-level bar.

Roving tabindex

Only one menu item is in the tab order at a time. With roving tabindex, the focused item has tabindex 0 and the rest have -1.

Activate and Close

Enter or Space runs the focused command and closes the menu. The menu should dismiss itself after a command is chosen.

Escape Returns Focus

Escape closes the menu without acting and sends focus back to the menu button, so the user lands exactly where they started.

Submenus Need More

A flyout submenu uses aria-haspopup on its parent menuitem, and Right Arrow opens it while Left Arrow closes it and returns.

Quick Check

You add a button that opens a list of commands. What signals to assistive tech that a menu will appear?

Recap

Menus are for commands, not page links: open with a haspopup button, move focus in, navigate with arrows and roving tabindex, and let Escape return focus. ✅

よくある質問

「メニュー、メニューバー、メニューボタン」レッスンは無料ですか?

はい。「メニュー、メニューバー、メニューボタン」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Web Accessibility Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Web Accessibility Academyコースには全4レッスンが含まれています。

「メニュー、メニューバー、メニューボタン」で何を学びますか?

正しいロールとキー操作でアプリのメニューを実装します。 ブラウザで直接実行するハンズオンコードでWeb Accessibility Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Web Accessibility Academyを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのWeb Accessibility Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン3/4です。

「メニュー、メニューバー、メニューボタン」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このWeb Accessibility Academyレッスンでコードを書いて実行できますか?

はい。すべてのWeb Accessibility Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. APGを読む:パターン、キー、例
  2. コンボボックスとオートコンプリートを正しく作る
  3. メニュー、メニューバー、メニューボタン
  4. treegridとその他の高度なパターン
← Web Accessibility Academyに戻る