Skip to content

Add Composite component#3649

Open
zamoore wants to merge 9 commits intomainfrom
zamore/hds-4843/AdvancedTable-keyboard_nav
Open

Add Composite component#3649
zamoore wants to merge 9 commits intomainfrom
zamore/hds-4843/AdvancedTable-keyboard_nav

Conversation

@zamoore
Copy link
Contributor

@zamoore zamoore commented Feb 25, 2026

📌 Summary

If merged, this PR adds a new HdsComposite component that provides accessible keyboard navigation (roving tabindex) for composite widget patterns such as toolbars, listboxes, and 2D grids. This will be used as a foundational building block for keyboard navigation in the AdvancedTable component.

🛠️ Detailed description

The Composite component implements the WAI-ARIA Composite keyboard navigation pattern using a modifier-based API. It yields three modifiers via a contextual hash:

  • {{c.composite}} - Applied to the container element. Listens for keydown events and manages the composite's tabindex when no item is active.
  • {{c.item}} - Applied to each navigable item. Manages roving tabindex (0 for active, 1 for inactive), data-active-item attribute, and aria-disabled. Accepts an optional disabled named argument.
  • {{c.group}} - Applied to row/group containers to enable 2D grid navigation.

Supported features:

  • @orientation - "horizontal", "vertical", or omitted for both axes. Controls which arrow keys are active.
  • @loop - true (all axes), "horizontal", or "vertical". Wraps focus from last to first (or vice versa) within the axis.
  • @wrap - true, "horizontal", or "vertical". In 2D grids, overflows navigation into adjacent rows/columns.
  • @defaultCurrentId - Pre-selects a specific item or explicitly sets no active item (null`).
2D grid navigation

When groups are present and no @orientation is set, switches to 2D mode with ArrowLeft/ArrowRight within rows, ArrowUp/ArrowDown across rows, Home/End for row edges, Ctrl+Home/Ctrl+End for grid edges, and PageUp/PageDown for column edges.

🔗 External links

Jira ticket: HDS-6131


👀 Component checklist

💬 Please consider using conventional comments when reviewing this PR.

📋 PCI review checklist
  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
  • If applicable, I've worked with GRC to document the impact of any changes to security controls.
    Examples of changes to controls include access controls, encryption, logging, etc.
  • If applicable, I've worked with GRC to ensure compliance due to a significant change to the in-scope PCI environment.
    Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.

@vercel
Copy link

vercel bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hds-showcase Ready Ready Preview Mar 4, 2026 2:25am
hds-website Ready Ready Preview Mar 4, 2026 2:25am

Request Review

@zamoore zamoore changed the base branch from main to zamoore/hds-5909/AdvancedTable-migrate_from_models February 25, 2026 22:30
@zamoore zamoore force-pushed the zamoore/hds-5909/AdvancedTable-migrate_from_models branch from 90251ce to fb80a65 Compare March 1, 2026 18:47
@zamoore zamoore force-pushed the zamore/hds-4843/AdvancedTable-keyboard_nav branch from c3437a1 to 1f4a4da Compare March 1, 2026 18:53
@zamoore zamoore changed the base branch from zamoore/hds-5909/AdvancedTable-migrate_from_models to main March 1, 2026 18:53
@hashibot-hds hashibot-hds added packages/flight-icons docs-website Updates to the documentation website labels Mar 1, 2026
@zamoore zamoore force-pushed the zamore/hds-4843/AdvancedTable-keyboard_nav branch from 1f4a4da to b3cbdd5 Compare March 1, 2026 19:02
@hashibot-hds hashibot-hds removed packages/flight-icons docs-website Updates to the documentation website labels Mar 1, 2026
@zamoore zamoore changed the title Zamore/hds 4843/advanced table keyboard nav Add Composite component Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants