Trên trang này

Trang này chưa có bản tiếng Việt, nội dung bên dưới là bản tiếng Anh. Xem trang tiếng Anh

Ô nhập

Keys, what Input gives you and what your team does.

Conformance

Input meets WCAG 2.2 level AA when used as described on these pages. It is a native <input>, so browsers and screen readers already know how to use it.

Keyboard

Key Action
Tab Moves focus into the field.
Shift + Tab Moves focus back out.
Typing, arrows, Home, End Edit the text, as in any browser field.

What Input gives you

  • A native text field, with its role and value exposed by the browser.
  • A visible focus: the edge turns color.border.focus (8:1 on the page) with a 2 px inset ring of the same colour, a 3 px solid edge.
  • An edge in color.border.bold, at least 3:1 on every surface, so the box can be seen (WCAG 1.4.11).
  • A red edge when aria-invalid="true" is set. The colour is only a second cue; the message says what is wrong.

What your team does

  • Give every field a visible label linked with for and id. A placeholder is not a label.
  • Link help text and errors with aria-describedby.
  • Set aria-invalid="true" when the value is wrong, and write the error in words under the field.
  • Set type and autocomplete (email, tel, organization) so browsers and password managers can fill the field.
  • Don’t disable a field without saying why, and don’t use a disabled or read-only field to show a value people can’t change: show it as text.

WCAG criteria

Criterion Level How
1.3.1 Info and Relationships A Label linked with for; help and error with aria-describedby
1.3.5 Identify Input Purpose AA autocomplete on fields about the user
1.4.11 Non-text Contrast AA color.border.bold edge, 3:1 or more
2.4.7 Focus Visible AA 3 px focus edge
3.3.1 Error Identification A Error message in words under the field
3.3.2 Labels or Instructions A Visible label, help text
4.1.2 Name, Role, Value A Native <input>

The text-field focus is a 3 px solid edge in color.border.focus, 8.0:1 on the page, with no gap and no halo, and meets 2.4.13 (decision D29).