本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)75k · #2858

form-labels

できること

このスキルは、フォームの入力欄に分かりやすく結び付いたラベルがあるかを確認します。多くの人が記入するフォームを作る開発者向けです。

使う場面

  • ✓フォームの欄に、プレースホルダーのテキストしかなく、本当のラベルがないとき。
  • ✓チェックボックスやラジオボタンのグループに、共通の質問がないとき。
  • ✓利用者がラベルをクリックして、入力欄にフォーカスできないとき。

スキルのリンク

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/form-labels/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/form-labels/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“フォームのすべての欄に、適切なラベルがあるか確認してもらえますか。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、for と id の属性を使って、各入力欄に結び付いたラベルがあるかを確認します。プレースホルダーだけの欄は、目に見えるラベルに置き換え、関連する選択肢は legend を持つ fieldset で囲みます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Associate labels with form controls

Properly associated labels ensure that screen readers can identify the purpose of form inputs and increase the clickable area for users with motor impairments.

Quick Reference

  • Use <label> elements for all form inputs
  • Connect labels using for and id attributes
  • Placeholder text is not a label and must not be the only field name
  • Use <fieldset> and <legend> when multiple controls share one question
  • Ensure every input has a clear, accessible name

Check

Verify that all form controls (input, select, textarea) have programmatically associated labels using the 'for' and 'id' attributes. Flag placeholder-only labels and grouped controls that lack a fieldset legend.

Fix

Add a <label> element with a 'for' attribute that matches the 'id' of the corresponding input field. Replace placeholder-only labels with real label text and wrap related checkboxes or radio buttons in a <fieldset> with a <legend>.

Explain

Explain why associated labels are critical for screen reader users and how they improve the hit area for touch and mouse users.

Code Review

Review the rendered markup and interactive states that affect Associate labels with form controls. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech. Specifically check for placeholder-only labels and question groups that visually share a heading but lack a semantic <fieldset> and <legend>.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/accessibility/form-labels

よくある質問

プレースホルダーだけでは不十分なのはなぜですか?

プレースホルダーのテキストは、入力を始めると消えてしまい、ラベルの代わりにはならないとこのスキルは説明しています。

fieldset は何をしますか?

ラジオボタンなどの関連する選択肢を、legend と呼ばれる一つの共通の質問の下にまとめます。

ラベルはなぜタッチの利用者の助けになりますか?

結び付いたラベルは、クリックできる領域を広げるため、手の動きに困難がある人の助けになるからです。

詳細

作者による元の説明

Use when reviewing rendered HTML, interactive components, or design-system patterns related to Associate labels with form controls. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#2858
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル