what is aria lable?
- User
what is aria lable?
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
what is aria lable?
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
aria-label — the 1-sentence definitionaria-label is an HTML attribute from the WAI-ARIA spec that supplies an invisible, screen-reader–friendly text label for an element when no visible label exists (or when you need to override it).
Screen readers announce interactive elements by reading their accessible name.
If the element has:
<button></button>)<span class="icon-trash"></span>)…aria-label steps in to give that name.
<button aria-label="Close modal">
✖ <!-- icon only -->
</button>
A sighted user sees just the “✖”; a screen-reader user hears “Close modal”.
| Scenario | Use aria-label? | Why |
|---|---|---|
| Icon-only button/link | ✔ | No other text to announce |
| Custom input (e.g., div styled as slider) | ✔ | Needs a name |
Element already has visible text (e.g., <button>Save</button>) | ✖ | Duplicate speech; use the real text |
Multiple elements share 1 visible label (e.g., form field + <label>) | ✖ | Prefer aria-labelledby / native <label for> |
const IconButton = ({ icon, label, onClick }) => (
<button
onClick={onClick}
aria-label={label} // accessible name
title={label} // optional mouse hover hint
className="icon-btn"
>
{icon}
</button>
);
// Usage
<IconButton icon={<TrashIcon />} label="Delete file" onClick={handleDelete} />
aria-labelledby when a visible label exists elsewhere; it keeps code DRY and text in sync.aria-describedby for that.🚀 Quick checklist
✓ Does the element visibly convey its purpose? If no, add aria-label.
✓ Is there already text or a <label>? If yes, skip aria-label.
That’s all—aria-label is your secret caption for assistive tech, making sure everyone gets the message even when the UI is purely visual.