Skip to content

feat(chip): add selection mode and toggle behavior#2764

Draft
fredvisser wants to merge 15 commits intomainfrom
users/fvisser/chip-toggle
Draft

feat(chip): add selection mode and toggle behavior#2764
fredvisser wants to merge 15 commits intomainfrom
users/fvisser/chip-toggle

Conversation

@fredvisser
Copy link
Copy Markdown
Contributor

@fredvisser fredvisser commented Nov 25, 2025

Pull Request

🤨 Rationale

Adds support for selection-mode on the nimble-chip component to allow for toggleable chips. This enables use cases where chips act as filter toggles or selectable items.

👩‍💻 Implementation

  • Added selectionMode attribute to Chip component.
  • Implemented selected state and styling.
  • Added click and keyboard handlers (Space/Enter to toggle, Escape to remove).
  • Managed tabindex to ensure proper accessibility for selectable chips.

🧪 Testing

  • Unit tests added for selection logic and keyboard interactions.
  • Verified accessibility behavior (tabindex management).

✅ Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed.

@fredvisser fredvisser force-pushed the users/fvisser/chip-toggle branch from fc883c7 to 33e0dc4 Compare November 25, 2025 15:51
@fredvisser fredvisser requested a review from jattasNI December 1, 2025 15:49
Copy link
Copy Markdown
Contributor

@jattasNI jattasNI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just reviewed API design, proposed behavior, and document structure so far, not actual implementation.

@@ -145,12 +145,18 @@ We will provide styling for the `disabled` attribute state.
_Consider the accessibility of the component, including:_

- _Keyboard Navigation and Focus_
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the API section above to include the new APIs too? The other md file seems more like copilot instructions for this specific feature but it's still helpful to keep the entire API summarized in this higher level spec.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the higher-level chip spec so the API section now includes the new public surface: selectable, selected, remove, and selected-change.

@fredvisser fredvisser requested a review from jattasNI April 8, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants