Skip to content

Conversation

liuliu-dev
Copy link
Contributor

@liuliu-dev liuliu-dev commented Oct 6, 2025

Closes #5916

Combines ActionList.Item and ActionList.LinkItem into a single unified ActionList.Item component that automatically switches between button and link behavior based on props. Developers no longer need to choose between Item and LinkItem

Changes

  • New unified API: ActionList.Item now supports both button and link functionality. Automatically uses link behavior when href, to, or link-related props are provided. Existing ActionList.Item usage continues to work unchanged
  • Internal refactor:
    • Renamed original Item to BaseItem
    • New Item component routes to BaseItem or LinkItem based on props
    • Updated LinkItem to use BaseItem internally
  • Documentation updates: Updated API docs to reflect the combined functionality
  • Update snapshots: Updated snapshots because the component name changed from ActionList.LinkItem to ActionList.Item

Usage Examples

// Button behavior (default)
<ActionList.Item onSelect={handleSelect}>
  Button item
</ActionList.Item>

// Link behavior 
<ActionList.Item href="/dashboard">
  Link item
</ActionList.Item>

// React Router link 
<ActionList.Item to="/settings" as={Link}>
  Router link item
</ActionList.Item>

Rollout strategy

  • Major release; if selected, include a written rollout or migration plan

Testing & Reviewing

Testing in github-ui: https://github.com/github/github-ui/pull/4026

Copy link

changeset-bot bot commented Oct 6, 2025

🦋 Changeset detected

Latest commit: 5dddb63

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@primer/react Major
@primer/styled-react Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Oct 6, 2025
Copy link
Contributor

github-actions bot commented Oct 6, 2025

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@github-actions github-actions bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Oct 6, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-6956 October 6, 2025 23:50 Inactive
@liuliu-dev
Copy link
Contributor Author

Testing completed, closing this PR and will build a more polished implementation

@liuliu-dev liuliu-dev closed this Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant