ARIA Widget Roles

ARIA role: textbox

Build a form with the HTML form generator

An editable text entry field. Prefer input type=text or textarea. Custom textbox needs a name and real editing behavior; aria-multiline describes multiline semantics. The example demonstrates a native equivalent or preferred alternative and deliberately omits redundant ARIA. Explicit roles do not implement visual presentation, interaction or focus management; verify allowed role/element combinations in ARIA in HTML. Accessibility exposure varies with browser, platform and assistive technology. Test relevant combinations; rendering is not proof of accessibility.

Formal Syntax & Structure

html syntaxhtml
role="textbox"

Parameters & Attributes

NameTypeDescription
roletokenExplicit role token textbox; use only where allowed. Omit when native semantics match.
aria-multilinebooleanRelevant when applicable. Describes whether a textbox accepts more than one line. It does not enable line breaks itself. Prefer textarea for multiline editing; implement appropriate Enter behavior in custom controls. Values: true, false.
aria-readonlybooleanRelevant when applicable. Indicates that a value cannot be edited but can generally still be read or interacted with. It does not prevent editing itself; use native readonly on supported text controls or enforce read-only behavior in a custom widget. Values: true, false.
aria-requiredbooleanRelevant when applicable. Communicates that user input is required before submission. It does not enforce validity, so prefer native required where supported and implement validation for custom controls. Provide visible instructions as well. Values: true, false.

Working Example

Example Snippethtml
<label for="comment">Comment</label><textarea id="comment"></textarea>
HTML Reference