Skip to content

[Table] Add displayName, scope attribute support, and caption element #642

@ravisuhag

Description

@ravisuhag

Summary

Table is a custom semantic HTML table wrapper using CVA + CSS Modules. Missing displayName on all sub-components, accessibility attributes, and API completeness.

Improvements

1. Add displayName to all sub-components

None of TableRoot, TableHeader, TableBody, TableRow, TableHead, TableCell, or SectionHeader have displayName set. All other compound components in the library have this.

2. Add scope attribute support to TableHead (WCAG 2.1)

<th> elements should support scope="col" or scope="row" to programmatically associate headers with data cells.

3. Add <caption> element support

No Caption sub-component exposed for screen reader context, despite CSS having caption-side: bottom.

4. Add aria-sort support for sortable columns

Headers can't indicate sort direction, needed for sortable table patterns.

5. Replace hardcoded CSS values

  • border-bottom: 0.5px — sub-pixel rendering issue
  • Sticky header top: 0px — should be top: 0

6. Normalize type signatures across sub-components

TableHead and TableCell use CVA variants but TableBody and TableRow don't. Inconsistent API surface.

7. Handle text truncation accessibility

Cells use text-overflow: ellipsis which hides content with no tooltip or accessible overflow mechanism.

Files

  • packages/raystack/raystack/components/table/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions