Skip to content

[a11y]: Data Table filter inputs missing aria-label across all example variants (WCAG 4.1.2) #10397

@akinshaywai

Description

@akinshaywai

Describe the bug

The Data Table examples across all variants (Radix, Base, and Tasks) use <Input placeholder="Filter emails/tasks..."> without an associated <label>, aria-label, or aria-labelledby attribute.

This means the filter input has no accessible name for screen reader users. Placeholder text alone is not a valid accessible name per WCAG 2.1. Screen readers may announce "edit text" or just "Filter emails..." with no context that this is a filter control.

This is a WCAG 2.1 Level A violation under Success Criterion 4.1.2: Name, Role, Value.

Affected files

  1. apps/v4/examples/radix/data-table-demo.tsx (line 204)
  2. apps/v4/examples/base/data-table-demo.tsx (line 206)
  3. apps/v4/app/(app)/examples/tasks/components/data-table-toolbar.tsx (line 25)

Why this matters

Since developers copy these examples directly into their projects, missing accessible labels propagate to thousands of production applications. Adding aria-label to these inputs ensures developers start with accessible patterns by default.

Suggested fix

Add aria-label to each filter input:

<Input
  aria-label="Filter emails"
  placeholder="Filter emails..."
  ...
/>

Affected component/components

Data Table, Input

How to reproduce

  1. Go to https://ui.shadcn.com/docs/components/data-table
  2. Open browser DevTools or a screen reader (VoiceOver/NVDA)
  3. Tab to the "Filter emails..." input field
  4. Screen reader announces "edit text" or just reads the placeholder with no label context
  5. Inspect the input element - no aria-label, no associated label element, no aria-labelledby
  6. Same issue exists on the Tasks example and Base variant

Codesandbox/StackBlitz link

https://ui.shadcn.com/docs/components/data-table

Logs

System Info

macOS, Chrome 135, VoiceOver screen reader, DevTools accessibility inspector

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions